Quoting espes (2015-01-26 14:33:16) > On 26 January 2015 at 02:19, Anton Khirnov <[email protected]> wrote: > > Quoting Alex Converse (2015-01-22 20:04:39) > >> From: espes <[email protected]> > >> > >> --- > >> libavcodec/aacdec.c | 16 ++++++++++++++-- > >> 1 file changed, 14 insertions(+), 2 deletions(-) > >> > >> diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c > >> index bca785c..eefaa37 100644 > >> --- a/libavcodec/aacdec.c > >> +++ b/libavcodec/aacdec.c > >> @@ -3235,8 +3235,20 @@ static int latm_decode_frame(AVCodecContext *avctx, > >> void *out, > >> return AVERROR_INVALIDDATA; > >> } > >> > >> - if ((err = aac_decode_frame_int(avctx, out, got_frame_ptr, &gb)) < 0) > >> - return err; > >> + if (latmctx->initialized) { > >> + switch (latmctx->aac_ctx.oc[1].m4ac.object_type) { > >> + case AOT_ER_AAC_LC: > >> + case AOT_ER_AAC_LTP: > >> + case AOT_ER_AAC_LD: > >> + case AOT_ER_AAC_ELD: > >> + err = aac_decode_er_frame(avctx, out, got_frame_ptr, &gb); > >> + break; > >> + default: > >> + err = aac_decode_frame_int(avctx, out, got_frame_ptr, &gb); > >> + } > >> + if (err < 0) > >> + return err; > >> + } > > > > Currently it does not check whether the context is initialized. Does it > > make a difference? > > It will always be true at that point in the code...
Then there's not much point in the if(), is there? It could be replaced with an av_assert0 and save an indent level. Either way, patch fine with me. -- Anton Khirnov _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
