diff mbox series

[FFmpeg-devel,207/281] dvaudio: convert to new channel layout API

Message ID 20220113020242.661-28-jamrial@gmail.com
State Accepted
Commit 502f7240fa030385cf1b881115fa1d471a396923
Headers show
Series New channel layout API | expand

Commit Message

James Almer Jan. 13, 2022, 2:02 a.m. UTC
From: Anton Khirnov <anton@khirnov.net>

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/dvaudiodec.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff mbox series

Patch

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;