diff mbox series

[FFmpeg-devel,010/279] 4xm: convert to new channel layout API

Message ID 20211208010649.381-11-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
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

James Almer Dec. 8, 2021, 1:06 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/4xm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index f918b1fc57..243c22965e 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -186,13 +186,14 @@  static int parse_strk(AVFormatContext *s,
 
     st->codecpar->codec_type            = AVMEDIA_TYPE_AUDIO;
     st->codecpar->codec_tag             = 0;
-    st->codecpar->channels              = fourxm->tracks[track].channels;
+    st->codecpar->ch_layout.order       = AV_CHANNEL_ORDER_UNSPEC;
+    st->codecpar->ch_layout.nb_channels = fourxm->tracks[track].channels;
     st->codecpar->sample_rate           = fourxm->tracks[track].sample_rate;
     st->codecpar->bits_per_coded_sample = fourxm->tracks[track].bits;
-    st->codecpar->bit_rate              = (int64_t)st->codecpar->channels *
+    st->codecpar->bit_rate              = (int64_t)st->codecpar->ch_layout.nb_channels *
                                           st->codecpar->sample_rate *
                                           st->codecpar->bits_per_coded_sample;
-    st->codecpar->block_align           = st->codecpar->channels *
+    st->codecpar->block_align           = st->codecpar->ch_layout.nb_channels *
                                           st->codecpar->bits_per_coded_sample;
 
     if (fourxm->tracks[track].adpcm){