diff mbox series

[FFmpeg-devel,033/281] au: convert to new channel layout API

Message ID 20220113015101.4-34-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_ppc success Make finished
andriy/make_fate_ppc 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: Vittorio Giovara <vittorio.giovara@gmail.com>

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/au.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/au.c b/libavformat/au.c
index 9bd408f65c..1de941e555 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -213,13 +213,14 @@  static int au_read_header(AVFormatContext *s)
     st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;
     st->codecpar->codec_tag   = id;
     st->codecpar->codec_id    = codec;
-    st->codecpar->channels    = channels;
+    st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
+    st->codecpar->ch_layout.nb_channels = channels;
     st->codecpar->sample_rate = rate;
     st->codecpar->bits_per_coded_sample = bps;
     st->codecpar->bit_rate    = channels * rate * bps;
-    st->codecpar->block_align = ba ? ba : FFMAX(bps * st->codecpar->channels / 8, 1);
+    st->codecpar->block_align = ba ? ba : FFMAX(bps * channels / 8, 1);
     if (data_size != AU_UNKNOWN_SIZE)
-        st->duration = (((int64_t)data_size)<<3) / (st->codecpar->channels * (int64_t)bps);
+        st->duration = (((int64_t)data_size)<<3) / (channels * (int64_t)bps);
 
     st->start_time = 0;
     avpriv_set_pts_info(st, 64, 1, rate);
@@ -304,7 +305,7 @@  static int au_write_header(AVFormatContext *s)
     avio_wb32(pb, AU_UNKNOWN_SIZE);             /* data size */
     avio_wb32(pb, par->codec_tag);              /* codec ID */
     avio_wb32(pb, par->sample_rate);
-    avio_wb32(pb, par->channels);
+    avio_wb32(pb, par->ch_layout.nb_channels);
     avio_write(pb, annotations.str, annotations.len & ~7);
 
 fail: