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

Michael Niedermayer michaelni
Sun Sep 5 19:04:24 CEST 2010


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?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100905/dc448d34/attachment.pgp>



More information about the ffmpeg-devel mailing list