diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-25 22:36:45 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-25 22:36:45 +0200 |
commit | eda5db6bd1f9a9e35353bf96f1e1fb8f15a2b7ad (patch) | |
tree | 369a097597ddcef6e063dbfb3ba2abf21c3253ff | |
parent | 2a672652bb70fe6ae1c711f80678f9a513732ee1 (diff) | |
download | ffmpeg-eda5db6bd1f9a9e35353bf96f1e1fb8f15a2b7ad.tar.gz |
mlpdec: discard a 2nd substream if the stream is mono
This fixes the rest of Ticket1726
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mlpdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index 5fae4d1160..141096b2f5 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -337,6 +337,10 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb) } else { m->avctx->channel_layout = ff_truehd_layout(mh.channels_thd_stream1); } + if (m->avctx->channels<=2 && m->avctx->channel_layout == AV_CH_LAYOUT_MONO && m->max_decoded_substream == 1) { + av_log(m->avctx, AV_LOG_DEBUG, "Mono stream with 2 substreams, ignoring 2nd\n"); + m->max_decoded_substream = 0; + } if (m->avctx->channels && !m->avctx->request_channels && !m->avctx->request_channel_layout && av_get_channel_layout_nb_channels(m->avctx->channel_layout) != m->avctx->channels) { |