aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ac3_parser.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2009-04-19 15:05:32 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2009-04-19 15:05:32 +0000
commitbfeca7beb63bc297c8c59469a53e469d11ec4d23 (patch)
tree407aa9c0f23f3b28a08a5c77e5290c86e698bb21 /libavcodec/ac3_parser.c
parentbe233a569165ad39a63ff2137763a123cd4f2562 (diff)
downloadffmpeg-bfeca7beb63bc297c8c59469a53e469d11ec4d23.tar.gz
Add channel layout support to the AC-3 decoder and AC-3 parser.
Originally committed as revision 18622 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3_parser.c')
-rw-r--r--libavcodec/ac3_parser.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/ac3_parser.c b/libavcodec/ac3_parser.c
index 35d8a17fb1..856f97aafb 100644
--- a/libavcodec/ac3_parser.c
+++ b/libavcodec/ac3_parser.c
@@ -121,6 +121,9 @@ int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
(hdr->num_blocks * 256.0));
hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;
}
+ hdr->channel_layout = ff_ac3_channel_layout_tab[hdr->channel_mode];
+ if (hdr->lfe_on)
+ hdr->channel_layout |= CH_LOW_FREQUENCY;
return 0;
}
@@ -174,6 +177,7 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
hdr_info->sample_rate = hdr.sample_rate;
hdr_info->bit_rate = hdr.bit_rate;
hdr_info->channels = hdr.channels;
+ hdr_info->channel_layout = hdr.channel_layout;
hdr_info->samples = hdr.num_blocks * 256;
if(hdr.bitstream_id>10)
hdr_info->codec_id = CODEC_ID_EAC3;