[FFmpeg-soc] [soc]: r3125 - aac/aac.c

superdump subversion at mplayerhq.hu
Sun Aug 10 13:17:09 CEST 2008


Author: superdump
Date: Sun Aug 10 13:17:08 2008
New Revision: 3125

Log:
Factor out ac->che[][] existence check from switch() in aac_decode_frame()


Modified:
   aac/aac.c

Modified: aac/aac.c
==============================================================================
--- aac/aac.c	(original)
+++ aac/aac.c	Sun Aug 10 13:17:08 2008
@@ -1826,6 +1826,10 @@ static int aac_decode_frame(AVCodecConte
     while ((elem_type = get_bits(&gb, 3)) != TYPE_END) {
         elem_id = get_bits(&gb, 4);
         err = -1;
+
+        if(elem_type && elem_type < TYPE_DSE && !ac->che[elem_type][elem_id])
+            return -1;
+
         switch (elem_type) {
 
         case TYPE_SCE:
@@ -1844,17 +1848,14 @@ static int aac_decode_frame(AVCodecConte
             break;
 
         case TYPE_CPE:
-            if (ac->che[TYPE_CPE][elem_id])
                 err = decode_cpe(ac, &gb, elem_id);
             break;
 
         case TYPE_CCE:
-            if (ac->che[TYPE_CCE][elem_id])
                 err = decode_cce(ac, &gb, elem_id);
             break;
 
         case TYPE_LFE:
-            if (ac->che[TYPE_LFE][elem_id])
                 err = decode_ics(ac, &ac->che[TYPE_LFE][elem_id]->ch[0], &gb, 0, 0);
             break;
 



More information about the FFmpeg-soc mailing list