avcodec/mlpdec: support for truehd with channels not representable with 5bit field in second stream

Fixes decoding for 4.0/4.1 layouts.
This commit is contained in:
Paul B Mahol 2023-10-25 12:43:13 +02:00
parent deb4c28dcc
commit 210e844def

View File

@ -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;