[FFmpeg-soc] [soc]: r2532 - aac/aac.c
superdump
subversion at mplayerhq.hu
Sun Jun 22 12:34:00 CEST 2008
Author: superdump
Date: Sun Jun 22 12:34:00 2008
New Revision: 2532
Log:
Improve readability of switch() by inserting \n and using if() else rather than
ternary
Modified:
aac/aac.c
Modified: aac/aac.c
==============================================================================
--- aac/aac.c (original)
+++ aac/aac.c Sun Jun 22 12:34:00 2008
@@ -2109,6 +2109,7 @@ static int aac_decode_frame(AVCodecConte
while ((id = get_bits(&gb, 3)) != ID_END) {
tag = get_bits(&gb, 4);
switch (id) {
+
case ID_SCE:
if(!ac->che[ID_SCE][tag]) {
if(tag == 1 && ac->che[ID_LFE][0]) {
@@ -2125,32 +2126,50 @@ static int aac_decode_frame(AVCodecConte
}
err = decode_ics(ac, &gb, 0, 0, &ac->che[ID_SCE][tag]->ch[0]);
break;
+
case ID_CPE:
- err = !ac->che[ID_CPE][tag] ? -1 : decode_cpe(ac, &gb, tag);
+ if (ac->che[ID_CPE][tag]) {
+ err = decode_cpe(ac, &gb, tag);
+ } else
+ err = -1;
break;
+
case ID_FIL:
- if (tag == 15) tag += get_bits(&gb, 8) - 1;
+ if (tag == 15)
+ tag += get_bits(&gb, 8) - 1;
while (tag > 0)
tag -= extension_payload(ac, &gb, tag);
err = 0; /* FIXME */
break;
+
case ID_PCE:
err = program_config_element(ac, &gb);
break;
+
case ID_DSE:
data_stream_element(ac, &gb, tag);
err = 0;
break;
+
case ID_CCE:
- err = !ac->che[ID_CCE][tag] ? -1 : decode_cce(ac, &gb, tag);
+ if (ac->che[ID_CCE][tag]) {
+ err = decode_cce(ac, &gb, tag);
+ } else
+ err = -1;
break;
+
case ID_LFE:
- err = ac->che[ID_LFE][tag] && !decode_ics(ac, &gb, 0, 0, &ac->che[ID_LFE][tag]->ch[0]) ? 0 : -1;
+ if (ac->che[ID_LFE][tag]) {
+ err = decode_ics(ac, &gb, 0, 0, &ac->che[ID_LFE][tag]->ch[0]);
+ } else
+ err = -1;
break;
+
default:
err = -1; /* should not happen, but keeps compiler happy */
break;
}
+
if(err)
return -1;
}
More information about the FFmpeg-soc
mailing list