Commit 932cee5d authored by Ramiro Polla's avatar Ramiro Polla

truehd: support up to 3 substreams.

Originally committed as revision 18072 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 952e2083
...@@ -34,10 +34,10 @@ ...@@ -34,10 +34,10 @@
*/ */
#define MAX_MATRICES 15 #define MAX_MATRICES 15
/** Maximum number of substreams that can be decoded. This could also be set /** Maximum number of substreams that can be decoded.
* higher, but I haven't seen any examples with more than two. * MLP's limit is 2. TrueHD supports at least up to 3.
*/ */
#define MAX_SUBSTREAMS 2 #define MAX_SUBSTREAMS 3
/** maximum sample frequency seen in files */ /** maximum sample frequency seen in files */
#define MAX_SAMPLERATE 192000 #define MAX_SAMPLERATE 192000
......
...@@ -280,6 +280,10 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb) ...@@ -280,6 +280,10 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
if (mh.num_substreams == 0) if (mh.num_substreams == 0)
return -1; return -1;
if (m->avctx->codec_id == CODEC_ID_MLP && mh.num_substreams > 2) {
av_log(m->avctx, AV_LOG_ERROR, "MLP only supports up to 2 substreams.\n");
return -1;
}
if (mh.num_substreams > MAX_SUBSTREAMS) { if (mh.num_substreams > MAX_SUBSTREAMS) {
av_log(m->avctx, AV_LOG_ERROR, av_log(m->avctx, AV_LOG_ERROR,
"Number of substreams %d is larger than the maximum supported " "Number of substreams %d is larger than the maximum supported "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment