[FFmpeg-devel] [PATCH] remove out-dated ADPCM frame_size handling in libavformat

Baptiste Coudurier baptiste.coudurier
Sun Sep 5 21:03:31 CEST 2010


On 9/5/10 10:04 AM, Michael Niedermayer wrote:
> On Sun, Sep 05, 2010 at 12:56:37PM -0400, Justin Ruggles wrote:
>> Hi,
>>
>> The ADPCM encoders all set AVCodecContext.frame_size so the really old
>> special-case handling in libavformat/utils.c:get_audio_frame_size() is
>> never used and is not needed.
>>
>> This is the first step in my attempt to get rid of all special-case
>> frame_size handling for PCM encoders.
>>
>> -Justin
>
>>   utils.c |    5 +----
>>   1 file changed, 1 insertion(+), 4 deletions(-)
>> ba9f8587ad6312838e3dcf155a29a5c37466b878  adpcm_frame_size.patch
>> Index: libavformat/utils.c
>> ===================================================================
>> --- libavformat/utils.c	(revision 24870)
>> +++ libavformat/utils.c	(working copy)
>> @@ -734,10 +734,7 @@
>>                   return -1;
>>               frame_size = (size<<  3) / (bits_per_sample * enc->channels);
>>           } else {
>> -            /* used for example by ADPCM codecs */
>> -            if (enc->bit_rate == 0)
>> -                return -1;
>> -            frame_size = ((int64_t)size * 8 * enc->sample_rate) / enc->bit_rate;
>> +            return -1;
>
> this should be assert(0) if it really never occurs, that way we will notice if
> it does occur (if asserts are enabled at least)
>
> and i assume you made sure that this case is never reached on any of the fate
> tests?

IIRC it is still used for decoding adpcm in wav.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list