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

superdump subversion at mplayerhq.hu
Mon Aug 11 00:07:44 CEST 2008


Author: superdump
Date: Mon Aug 11 00:07:44 2008
New Revision: 3160

Log:
Factor out incorrectly coded 5.1 stream workaround from switch in
aac_decode_frame()


Modified:
   aac/aac.c

Modified: aac/aac.c
==============================================================================
--- aac/aac.c	(original)
+++ aac/aac.c	Mon Aug 11 00:07:44 2008
@@ -1785,23 +1785,20 @@ static int aac_decode_frame(AVCodecConte
         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:
-            if(!ac->che[TYPE_SCE][elem_id]) {
-                if(elem_id == 1 && ac->che[TYPE_LFE][0]) {
+            if(elem_type == TYPE_SCE && elem_id = 1 && !ac->che[TYPE_SCE][elem_id] && ac->che[TYPE_LFE][0]) {
                     /* Some streams incorrectly code 5.1 audio as SCE[0] CPE[0] CPE[1] SCE[1]
                        instead of SCE[0] CPE[0] CPE[0] LFE[0].
                        If we seem to have encountered such a stream,
                        transfer the LFE[0] element to SCE[1] */
                     ac->che[TYPE_SCE][elem_id] = ac->che[TYPE_LFE][0];
                     ac->che[TYPE_LFE][0] = NULL;
-                } else
-                    break;
             }
+        if(elem_type && elem_type < TYPE_DSE && !ac->che[elem_type][elem_id])
+            return -1;
+
+        switch (elem_type) {
+
+        case TYPE_SCE:
             err = decode_ics(ac, &ac->che[TYPE_SCE][elem_id]->ch[0], &gb, 0, 0);
             break;
 



More information about the FFmpeg-soc mailing list