From 13345fc1f86fc3615789e196d5a339c1c27c9068 Mon Sep 17 00:00:00 2001 From: Tim Walker Date: Wed, 11 Dec 2013 02:03:34 +0000 Subject: (e)ac3: parse and store the Dolby Surround, Surround EX and Headphone mode flags. --- libavcodec/eac3dec.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libavcodec/eac3dec.c') diff --git a/libavcodec/eac3dec.c b/libavcodec/eac3dec.c index baba454fd6..fb6c51bcb8 100644 --- a/libavcodec/eac3dec.c +++ b/libavcodec/eac3dec.c @@ -341,6 +341,11 @@ int ff_eac3_parse_header(AC3DecodeContext *s) } } + /* default dolby matrix encoding modes */ + s->dolby_surround_mode = AC3_DSURMOD_NOTINDICATED; + s->dolby_surround_ex_mode = AC3_DSUREXMOD_NOTINDICATED; + s->dolby_headphone_mode = AC3_DHEADPHONMOD_NOTINDICATED; + /* mixing metadata */ if (get_bits1(gbc)) { /* center and surround mix levels */ @@ -413,10 +418,11 @@ int ff_eac3_parse_header(AC3DecodeContext *s) s->bitstream_mode = get_bits(gbc, 3); skip_bits(gbc, 2); // skip copyright bit and original bitstream bit if (s->channel_mode == AC3_CHMODE_STEREO) { - skip_bits(gbc, 4); // skip Dolby surround and headphone mode + s->dolby_surround_mode = get_bits(gbc, 2); + s->dolby_headphone_mode = get_bits(gbc, 2); } if (s->channel_mode >= AC3_CHMODE_2F2R) { - skip_bits(gbc, 2); // skip Dolby surround EX mode + s->dolby_surround_ex_mode = get_bits(gbc, 2); } for (i = 0; i < (s->channel_mode ? 1 : 2); i++) { if (get_bits1(gbc)) { -- cgit v1.2.3