summaryrefslogtreecommitdiff
path: root/libavcodec/mlpdec.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2021-09-18 19:15:21 +0200
committerPaul B Mahol <onemda@gmail.com>2021-09-23 23:43:48 +0200
commit57f0b36367d4e5ccd4d2da7f69c3cac45b6236ee (patch)
tree162738ec1441c3a6c455cdfa8e8a5212ea59f240 /libavcodec/mlpdec.c
parent6a1bda3df93ec879ce16fc09b0f4be1be2bc9e95 (diff)
avcodec/mlpdec: fix decoding single stereo stream in TrueHD
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 fef92c5a31..6c2940903f 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -407,6 +407,8 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
mh.stream_type);
return AVERROR_PATCHWELCOME;
}
+ if (mh.channel_modifier_thd_stream0 == THD_CH_MODIFIER_STEREO)
+ m->substream[0].mask = AV_CH_LAYOUT_STEREO;
if ((substr = (mh.num_substreams > 1)))
m->substream[0].mask = AV_CH_LAYOUT_STEREO;
if (mh.num_substreams > 2)
@@ -414,7 +416,7 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
m->substream[2].mask = mh.channel_layout_thd_stream2;
else
m->substream[2].mask = mh.channel_layout_thd_stream1;
- m->substream[substr].mask = mh.channel_layout_thd_stream1;
+ m->substream[1].mask = mh.channel_layout_thd_stream1;
if (m->avctx->channels<=2 && m->substream[substr].mask == AV_CH_LAYOUT_MONO && m->max_decoded_substream == 1) {
av_log(m->avctx, AV_LOG_DEBUG, "Mono stream with 2 substreams, ignoring 2nd\n");