[FFmpeg-devel] [PATCH 1/4] lavc/aacdec: handle case where extradata is set between init and first packet

Hendrik Leppkes h.leppkes at gmail.com
Tue Sep 22 08:17:23 CEST 2015


On Tue, Sep 22, 2015 at 4:50 AM, Rodger Combs <rodger.combs at gmail.com> wrote:
> ---
>  libavcodec/aacdec_template.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
> index c2d7d05..48717c7 100644
> --- a/libavcodec/aacdec_template.c
> +++ b/libavcodec/aacdec_template.c
> @@ -3118,6 +3118,14 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data,
>          }
>      }
>
> +    if (!avctx->channels && avctx->extradata_size > 0) {
> +        if ((err = decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
> +                                                avctx->extradata,
> +                                                avctx->extradata_size * 8LL,
> +                                                1)) < 0)
> +            return err;
> +    }
> +
>      ac->dmono_mode = 0;
>      if (jp_dualmono && jp_dualmono_size > 0)
>          ac->dmono_mode =  1 + *jp_dualmono;

This is not valid API usage for a decoder. It should either be set
before opening, or use in-band information.


More information about the ffmpeg-devel mailing list