summaryrefslogtreecommitdiff
path: root/libavcodec/ac3dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-19 21:36:49 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-19 21:37:06 +0100
commit3a5a039adee3ee928898df82e20c40212d618195 (patch)
tree31eded7f2053f1843389c5b3f5bc4b3e36b8491b /libavcodec/ac3dec.c
parentc3d12156839475510e38df0bc3777a8781a3e7a8 (diff)
parentc229f571fd3c7d7b567c27c87b2bbcdaee1b0e9f (diff)
Merge commit 'c229f571fd3c7d7b567c27c87b2bbcdaee1b0e9f'
* commit 'c229f571fd3c7d7b567c27c87b2bbcdaee1b0e9f': (e)ac3: parse and store the Lt/Rt and LFE mix levels. Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ac3dec.c')
-rw-r--r--libavcodec/ac3dec.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index a8e929bc64..62f88d042a 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -227,16 +227,20 @@ static int ac3_parse_header(AC3DecodeContext *s)
skip_bits(gbc, 2); //skip copyright bit and original bitstream bit
- /* skip the timecodes or parse the Alternate Bit Stream Syntax
- TODO: read & use the xbsi1 downmix levels */
+ /* skip the timecodes or parse the Alternate Bit Stream Syntax */
if (s->bitstream_id != 6) {
if (get_bits1(gbc))
skip_bits(gbc, 14); //skip timecode1
if (get_bits1(gbc))
skip_bits(gbc, 14); //skip timecode2
} else {
- if (get_bits1(gbc))
- skip_bits(gbc, 14); //skip xbsi1
+ if (get_bits1(gbc)) {
+ s->preferred_downmix = get_bits(gbc, 2);
+ s->center_mix_level_ltrt = get_bits(gbc, 3);
+ s->surround_mix_level_ltrt = get_bits(gbc, 3);
+ s->center_mix_level = get_bits(gbc, 3);
+ s->surround_mix_level = get_bits(gbc, 3);
+ }
if (get_bits1(gbc)) {
s->dolby_surround_ex_mode = get_bits(gbc, 2);
s->dolby_headphone_mode = get_bits(gbc, 2);
@@ -280,8 +284,12 @@ static int parse_frame_header(AC3DecodeContext *s)
s->fbw_channels = s->channels - s->lfe_on;
s->lfe_ch = s->fbw_channels + 1;
s->frame_size = hdr.frame_size;
+ s->preferred_downmix = AC3_DMIXMOD_NOTINDICATED;
s->center_mix_level = hdr.center_mix_level;
+ s->center_mix_level_ltrt = 4; // -3.0dB
s->surround_mix_level = hdr.surround_mix_level;
+ s->surround_mix_level_ltrt = 4; // -3.0dB
+ s->lfe_mix_level_exists = 0;
s->num_blocks = hdr.num_blocks;
s->frame_type = hdr.frame_type;
s->substreamid = hdr.substreamid;