avcodec/tta: fix regression with new channel layout switch

This commit is contained in:
Paul B Mahol 2023-02-11 16:48:11 +01:00
parent 385ec46424
commit 27315dc345
1 changed files with 2 additions and 1 deletions

View File

@ -160,7 +160,8 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
av_channel_layout_uninit(&avctx->ch_layout); av_channel_layout_uninit(&avctx->ch_layout);
if (s->channels > 1 && s->channels < 9) { if (s->channels > 1 && s->channels < 9) {
av_channel_layout_from_mask(&avctx->ch_layout, tta_channel_layouts[s->channels-2]); av_channel_layout_from_mask(&avctx->ch_layout, tta_channel_layouts[s->channels-2]);
} else { }
if (avctx->ch_layout.nb_channels == 0) {
avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
avctx->ch_layout.nb_channels = s->channels; avctx->ch_layout.nb_channels = s->channels;
} }