[FFmpeg-soc] [soc]: r5121 - als/alsdec.c

Justin Ruggles justin.ruggles at gmail.com
Sat Aug 15 15:10:28 CEST 2009


Thilo Borgmann wrote:

>>> -        // Do not continue in case of a damaged stream
>>> +        // do not continue in case of a damaged stream since
>>> +        // block_length must be evenly divisible by sub_blocks
>>>          if (block_length % sub_blocks)
>>>              return -1;
>> Wouldn't it be nicer to print a warning and just decrease block_length
>> to the next smaller multiple of sub_blocks? Depending on how the
>> format is this might improve decoding of damaged streams (e.g. last
>> block in an incomplete file).
> 
> I agree a warning makes absolute sense here. I will add it later if no
> one else intervene here.
> 
> The other thing would have to be elaborated. My first impression is that
> it would make sense for the very last block only. Otherwise the rest of
> the frame would be misdecoded. And I don't know enough about the
> demuxer... if it would be able to pass the next frame in such a case
> although block length has changed (less bits decoded)?

If sub_blocks is wrong, this means that the damage happened sometime in
the past, and trying to read anything at all from this block will almost
certainly give only noise, and all subsequent blocks will also be noise.

You could print a warning and return an error for the block, but maybe
instead of discarding the whole frame, try to salvage any previous
blocks by keeping the sample data you already have and zeroing out the rest.

-Justin



More information about the FFmpeg-soc mailing list