[FFmpeg-cvslog] aacdec: Refactor aac_er_decode_frame.

Alex Converse git at videolan.org
Wed Feb 4 13:30:16 CET 2015


ffmpeg | branch: master | Alex Converse <alex.converse at gmail.com> | Wed Jan 21 21:49:29 2015 -0800| [edd9ea3ffba1d5873dead1c57c74b1e3cc912167] | committer: Alex Converse

aacdec: Refactor aac_er_decode_frame.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=edd9ea3ffba1d5873dead1c57c74b1e3cc912167
---

 libavcodec/aacdec.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 549e5e5..90de276 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -2703,11 +2703,12 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
                                int *got_frame_ptr, GetBitContext *gb)
 {
     AACContext *ac = avctx->priv_data;
+    const MPEG4AudioConfig *const m4ac = &ac->oc[1].m4ac;
     ChannelElement *che;
     int err, i;
     int samples = 1024;
-    int chan_config = ac->oc[1].m4ac.chan_config;
-    int aot = ac->oc[1].m4ac.object_type;
+    int chan_config = m4ac->chan_config;
+    int aot = m4ac->object_type;
 
     if (aot == AOT_ER_AAC_LD || aot == AOT_ER_AAC_ELD)
         samples >>= 1;
@@ -2719,13 +2720,13 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
 
     // The FF_PROFILE_AAC_* defines are all object_type - 1
     // This may lead to an undefined profile being signaled
-    ac->avctx->profile = ac->oc[1].m4ac.object_type - 1;
+    ac->avctx->profile = aot - 1;
 
     ac->tags_mapped = 0;
 
     if (chan_config < 0 || chan_config >= 8) {
         avpriv_request_sample(avctx, "Unknown ER channel configuration %d",
-                              ac->oc[1].m4ac.chan_config);
+                              chan_config);
         return AVERROR_INVALIDDATA;
     }
     for (i = 0; i < tags_per_config[chan_config]; i++) {



More information about the ffmpeg-cvslog mailing list