diff mbox series

[FFmpeg-devel,034/281] avr: convert to new channel layout API

Message ID 20220113015101.4-35-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_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
andriy/make_ppc success Make finished
andriy/make_fate_ppc 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/avr.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/avr.c b/libavformat/avr.c
index 6fdcf68952..14a633ea5d 100644
--- a/libavformat/avr.c
+++ b/libavformat/avr.c
@@ -52,10 +52,11 @@  static int avr_read_header(AVFormatContext *s)
     avio_skip(s->pb, 8); // sample_name
 
     chan = avio_rb16(s->pb);
+    st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
     if (!chan) {
-        st->codecpar->channels = 1;
+        st->codecpar->ch_layout.nb_channels = 1;
     } else if (chan == 0xFFFFu) {
-        st->codecpar->channels = 2;
+        st->codecpar->ch_layout.nb_channels = 2;
     } else {
         avpriv_request_sample(s, "chan %d", chan);
         return AVERROR_PATCHWELCOME;
@@ -81,7 +82,7 @@  static int avr_read_header(AVFormatContext *s)
         return AVERROR_PATCHWELCOME;
     }
 
-    st->codecpar->block_align = bps * st->codecpar->channels / 8;
+    st->codecpar->block_align = bps * st->codecpar->ch_layout.nb_channels / 8;
 
     avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
     return 0;