[FFmpeg-devel] [PATCH 223/281] libcodec2: convert to new channel layout API

James Almer jamrial at gmail.com
Thu Jan 13 04:05:02 EET 2022


From: Anton Khirnov <anton at khirnov.net>

Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/libcodec2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libcodec2.c b/libavcodec/libcodec2.c
index eb66867f82..da9e170d21 100644
--- a/libavcodec/libcodec2.c
+++ b/libavcodec/libcodec2.c
@@ -85,9 +85,9 @@ libcodec2_init_common_error:
 static av_cold int libcodec2_init_decoder(AVCodecContext *avctx)
 {
     avctx->sample_rate      = 8000;
-    avctx->channels         = 1;
     avctx->sample_fmt       = AV_SAMPLE_FMT_S16;
-    avctx->channel_layout   = AV_CH_LAYOUT_MONO;
+    av_channel_layout_uninit(&avctx->ch_layout);
+    avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
 
     if (avctx->extradata_size != CODEC2_EXTRADATA_SIZE) {
         av_log(avctx, AV_LOG_ERROR, "must have exactly %i bytes of extradata (got %i)\n",
-- 
2.34.1



More information about the ffmpeg-devel mailing list