[FFmpeg-cvslog] mlpdec: support TrueHD streams with an Atmos substream

Hendrik Leppkes git at videolan.org
Sun Sep 21 14:39:15 CEST 2014


ffmpeg | branch: master | Hendrik Leppkes <h.leppkes at gmail.com> | Sun Sep 21 02:29:28 2014 +0200| [36bf549b2706bd10014556a84a33ed6daf5d5373] | committer: Michael Niedermayer

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 at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=36bf549b2706bd10014556a84a33ed6daf5d5373
---

 libavcodec/mlp.h    |    2 +-
 libavcodec/mlpdec.c |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mlp.h b/libavcodec/mlp.h
index bb9ca26..05d8dba 100644
--- a/libavcodec/mlp.h
+++ b/libavcodec/mlp.h
@@ -45,7 +45,7 @@
 /** Maximum number of substreams that can be decoded.
  *  MLP's limit is 2. TrueHD supports at least up to 3.
  */
-#define MAX_SUBSTREAMS      3
+#define MAX_SUBSTREAMS      4
 
 /** which multiple of 48000 the maximum sample rate is */
 #define MAX_RATEFACTOR      4
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index fddeb14..e443f81 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;



More information about the ffmpeg-cvslog mailing list