summaryrefslogtreecommitdiff
path: root/libavcodec/mlpdec.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2014-09-21 02:29:28 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-09-21 14:38:32 +0200
commit36bf549b2706bd10014556a84a33ed6daf5d5373 (patch)
tree31ab10a21b005947e2cd6a20c595e8fce15c0b4d /libavcodec/mlpdec.c
parentff34b2d6d35b212523428b9b932cce4914f7ac03 (diff)
mlpdec: support TrueHD streams with an Atmos substream
The fourth substream is being discarded, since its not raw audio data, but an encoded Atmos stream which needs a specialized decoder. Fixes decoding of the true hd stream from Transformers\ -\ Age\ of\ Extinction\ 2014\ 1080P-003.mkv Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mlpdec.c')
-rw-r--r--libavcodec/mlpdec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index fddeb14ad7..e443f812bd 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -358,7 +358,9 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
m->access_unit_size_pow2 = mh.access_unit_size_pow2;
m->num_substreams = mh.num_substreams;
- m->max_decoded_substream = m->num_substreams - 1;
+
+ /* limit to decoding 3 substreams, as the 4th is used by Dolby Atmos for non-audio data */
+ m->max_decoded_substream = FFMIN(m->num_substreams - 1, 2);
m->avctx->sample_rate = mh.group1_samplerate;
m->avctx->frame_size = mh.access_unit_size;