diff ac3dec.c @ 9983:68de5143aa45 libavcodec

refactoring: properly separate AC-3 and E-AC-3 code
author diego
date Thu, 23 Jul 2009 02:33:25 +0000
parents daa53251c64d
children 0649c00003a1
line wrap: on
line diff
--- a/ac3dec.c	Thu Jul 23 00:15:23 2009 +0000
+++ b/ac3dec.c	Thu Jul 23 02:33:25 2009 +0000
@@ -314,9 +314,12 @@
         s->skip_syntax           = 1;
         memset(s->channel_uses_aht, 0, sizeof(s->channel_uses_aht));
         return ac3_parse_header(s);
-    } else {
+    } else if (CONFIG_EAC3_DECODER) {
         s->eac3 = 1;
         return ff_eac3_parse_header(s);
+    } else {
+        av_log(s->avctx, AV_LOG_ERROR, "E-AC-3 support not compiled in\n");
+        return -1;
     }
 }
 
@@ -559,7 +562,7 @@
         /* if AHT is used, mantissas for all blocks are encoded in the first
            block of the frame. */
         int bin;
-        if (!blk)
+        if (!blk && CONFIG_EAC3_DECODER)
             ff_eac3_decode_transform_coeffs_aht_ch(s, ch);
         for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
             s->fixed_coeffs[ch][bin] = s->pre_mantissa[ch][bin][blk] >> s->dexps[ch][bin];