diff ac3dec.c @ 9512:ba5d9a97ab2f libavcodec

Add channel layout support to the AC-3 decoder and AC-3 parser.
author jbr
date Sun, 19 Apr 2009 15:05:32 +0000
parents 7db61b0d21f9
children 93029f1a4c14
line wrap: on
line diff
--- a/ac3dec.c	Sun Apr 19 14:05:55 2009 +0000
+++ b/ac3dec.c	Sun Apr 19 15:05:32 2009 +0000
@@ -285,6 +285,7 @@
     /* get decoding parameters from header info */
     s->bit_alloc_params.sr_code     = hdr.sr_code;
     s->channel_mode                 = hdr.channel_mode;
+    s->channel_layout               = hdr.channel_layout;
     s->lfe_on                       = hdr.lfe_on;
     s->bit_alloc_params.sr_shift    = hdr.sr_shift;
     s->sample_rate                  = hdr.sample_rate;
@@ -1307,8 +1308,10 @@
                 avctx->request_channels < s->channels) {
             s->out_channels = avctx->request_channels;
             s->output_mode  = avctx->request_channels == 1 ? AC3_CHMODE_MONO : AC3_CHMODE_STEREO;
+            s->channel_layout = ff_ac3_channel_layout_tab[s->output_mode];
         }
         avctx->channels = s->out_channels;
+        avctx->channel_layout = s->channel_layout;
 
         /* set downmixing coefficients if needed */
         if(s->channels != s->out_channels && !((s->output_mode & AC3_OUTPUT_LFEON) &&