diff mbox series

[FFmpeg-devel,177/281] wve: convert to new channel layout API

Message ID 20220113020026.590-29-jamrial@gmail.com
State New
Headers show
Series New channel layout API
Related show

Commit Message

James Almer Jan. 13, 2022, 2 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/wvedec.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/wvedec.c b/libavformat/wvedec.c
index f133da3c87..9b2f7036e0 100644
--- a/libavformat/wvedec.c
+++ b/libavformat/wvedec.c
@@ -43,9 +43,11 @@  static int wve_read_header(AVFormatContext *s)
     st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;
     st->codecpar->codec_id    = AV_CODEC_ID_PCM_ALAW;
     st->codecpar->sample_rate = 8000;
-    st->codecpar->channels    = 1;
+    st->codecpar->ch_layout.order       = AV_CHANNEL_ORDER_UNSPEC;
+    st->codecpar->ch_layout.nb_channels = 1;
     st->codecpar->bits_per_coded_sample = av_get_bits_per_sample(st->codecpar->codec_id);
-    st->codecpar->block_align = st->codecpar->bits_per_coded_sample * st->codecpar->channels / 8;
+    st->codecpar->block_align = st->codecpar->bits_per_coded_sample *
+                                st->codecpar->ch_layout.nb_channels / 8;
     avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
     avio_skip(s->pb, 10);