diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index 8e6f1fc5f3..5032b31bb8 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -578,10 +578,9 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp, cp->huff_lsbs = 24; } - if (substr == m->max_decoded_substream && - m->avctx->channels != s->max_matrix_channel + 1) { - m->avctx->channels = s->max_matrix_channel + 1; - m->avctx->channel_layout = 0; + if (substr == m->max_decoded_substream) { + m->avctx->channels = s->max_matrix_channel + 1; + m->avctx->channel_layout = s->ch_layout; } return 0;