diff mbox series

[FFmpeg-devel,014/281] acm: convert to new channel layout API

Message ID 20220113015101.4-15-jamrial@gmail.com
State New
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/acm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/acm.c b/libavformat/acm.c
index 0ee9114f70..a6da000130 100644
--- a/libavformat/acm.c
+++ b/libavformat/acm.c
@@ -48,12 +48,13 @@  static int acm_read_header(AVFormatContext *s)
     if (ret < 0)
         return ret;
 
-    st->codecpar->channels    = AV_RL16(st->codecpar->extradata +  8);
+    st->codecpar->ch_layout.order       = AV_CHANNEL_ORDER_UNSPEC;
+    st->codecpar->ch_layout.nb_channels = AV_RL16(st->codecpar->extradata +  8);
     st->codecpar->sample_rate = AV_RL16(st->codecpar->extradata + 10);
-    if (st->codecpar->channels <= 0 || st->codecpar->sample_rate <= 0)
+    if (st->codecpar->ch_layout.nb_channels <= 0 || st->codecpar->sample_rate <= 0)
         return AVERROR_INVALIDDATA;
     st->start_time         = 0;
-    st->duration           = AV_RL32(st->codecpar->extradata +  4) / st->codecpar->channels;
+    st->duration           = AV_RL32(st->codecpar->extradata +  4) / st->codecpar->ch_layout.nb_channels;
     ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL_RAW;
     avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);