diff options
author | Paul B Mahol <onemda@gmail.com> | 2023-10-25 12:43:13 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2023-10-27 12:45:23 +0200 |
commit | 210e844def9d2c5a1e3840b8c5ad9c094b74a871 (patch) | |
tree | 5aaa62fb301eea11b3258b3e1380779aab7a7bca /libavcodec | |
parent | deb4c28dcc9c28287710e2810213837f854241dc (diff) | |
download | ffmpeg-210e844def9d2c5a1e3840b8c5ad9c094b74a871.tar.gz |
avcodec/mlpdec: support for truehd with channels not representable with 5bit field in second stream
Fixes decoding for 4.0/4.1 layouts.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mlpdec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index 11b5d2fe98..f1524b95a6 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -452,7 +452,10 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb) else m->substream[2].mask = mh.channel_layout_thd_stream1; if (m->avctx->ch_layout.nb_channels > 2) - m->substream[mh.num_substreams > 1].mask = mh.channel_layout_thd_stream1; + if (mh.num_substreams > 2) + m->substream[1].mask = mh.channel_layout_thd_stream1; + else + m->substream[mh.num_substreams > 1].mask = mh.channel_layout_thd_stream2; } m->needs_reordering = mh.channel_arrangement >= 18 && mh.channel_arrangement <= 20; |