[FFmpeg-devel] [PATCH 009/244] 4xm: convert to new channel layout API

Anton Khirnov anton at khirnov.net
Fri Dec 6 12:17:03 EET 2019


From: Vittorio Giovara <vittorio.giovara at gmail.com>

Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>
---
 libavformat/4xm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index a6101a92ec..864e525e09 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -184,13 +184,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){
-- 
2.24.0



More information about the ffmpeg-devel mailing list