diff --git a/libavcodec/dvaudiodec.c b/libavcodec/dvaudiodec.c index 82e6dbe36c..f3b1dee075 100644 --- a/libavcodec/dvaudiodec.c +++ b/libavcodec/dvaudiodec.c @@ -36,11 +36,6 @@ static av_cold int decode_init(AVCodecContext *avctx) DVAudioContext *s = avctx->priv_data; int i; - if (avctx->channels != 2) { - av_log(avctx, AV_LOG_ERROR, "invalid number of channels\n"); - return AVERROR(EINVAL); - } - if (avctx->codec_tag == 0x0215) { s->block_size = 7200; } else if (avctx->codec_tag == 0x0216) { @@ -55,7 +50,8 @@ static av_cold int decode_init(AVCodecContext *avctx) s->is_pal = s->block_size == 8640; s->is_12bit = avctx->bits_per_coded_sample == 12; avctx->sample_fmt = AV_SAMPLE_FMT_S16; - avctx->channel_layout = AV_CH_LAYOUT_STEREO; + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; for (i = 0; i < FF_ARRAY_ELEMS(s->shuffle); i++) { const unsigned a = s->is_pal ? 18 : 15;