[libav-devel] [PATCH 018/264] ff_parse_specific_params: do not use AVCodecContext.frame_size

Luca Barbato lu_zero at gentoo.org
Sun Dec 6 11:40:29 CET 2015


On 06/12/15 10:58, Anton Khirnov wrote:
> It will not be set unless the muxing codec context is also the encoding
> context, which is discouraged. When the frame size is not known from
> av_get_audio_frame_duration(), the fallback should still be good enough.
> ---
>  libavformat/riffenc.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c
> index 81b3b2d..2e4b7e0 100644
> --- a/libavformat/riffenc.c
> +++ b/libavformat/riffenc.c
> @@ -212,12 +212,7 @@ void ff_parse_specific_params(AVStream *st, int *au_rate,
>      int gcd;
>      int audio_frame_size;
>  
> -    /* We use the known constant frame size for the codec if known, otherwise
> -     * fall back on using AVCodecContext.frame_size, which is not as reliable
> -     * for indicating packet duration. */
>      audio_frame_size = av_get_audio_frame_duration(codec, 0);
> -    if (!audio_frame_size)
> -        audio_frame_size = codec->frame_size;
>  
>      *au_ssize = codec->block_align;
>      if (audio_frame_size && codec->sample_rate) {
> 

Fine for me.


More information about the libav-devel mailing list