diff mbox series

[FFmpeg-devel,020/281] afc: convert to new channel layout API

Message ID 20220113015101.4-21-jamrial@gmail.com
State Accepted
Commit 14bbc23b683a36d5f6b28bee2c003ef6fbc64afc
Headers show
Series New channel layout API | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished

Commit Message

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

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/afc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/afc.c b/libavformat/afc.c
index 102b74baeb..898c7d03eb 100644
--- a/libavformat/afc.c
+++ b/libavformat/afc.c
@@ -38,12 +38,11 @@  static int afc_read_header(AVFormatContext *s)
         return AVERROR(ENOMEM);
     st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
     st->codecpar->codec_id   = AV_CODEC_ID_ADPCM_AFC;
-    st->codecpar->channels   = 2;
-    st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
+    st->codecpar->ch_layout  = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO;
 
     if ((ret = ff_alloc_extradata(st->codecpar, 1)) < 0)
         return ret;
-    st->codecpar->extradata[0] = 8 * st->codecpar->channels;
+    st->codecpar->extradata[0] = 8 * st->codecpar->ch_layout.nb_channels;
 
     c->data_end = avio_rb32(s->pb) + 32LL;
     st->duration = avio_rb32(s->pb);