diff mbox series

[FFmpeg-devel,056/281] electronicarts: convert to new channel layout API

Message ID 20220113015101.4-57-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
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished

Commit Message

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

Patch

diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index 2fb09b34ca..811f8705e5 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -551,13 +551,14 @@  static int ea_read_header(AVFormatContext *s)
         st->codecpar->codec_type            = AVMEDIA_TYPE_AUDIO;
         st->codecpar->codec_id              = ea->audio_codec;
         st->codecpar->codec_tag             = 0;   /* no tag */
-        st->codecpar->channels              = ea->num_channels;
+        st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
+        st->codecpar->ch_layout.nb_channels = ea->num_channels;
         st->codecpar->sample_rate           = ea->sample_rate;
         st->codecpar->bits_per_coded_sample = ea->bytes * 8;
-        st->codecpar->bit_rate              = (int64_t)st->codecpar->channels *
+        st->codecpar->bit_rate              = (int64_t)ea->num_channels *
                                               st->codecpar->sample_rate *
                                               st->codecpar->bits_per_coded_sample / 4;
-        st->codecpar->block_align           = st->codecpar->channels *
+        st->codecpar->block_align           = ea->num_channels *
                                               st->codecpar->bits_per_coded_sample;
         ea->audio_stream_index           = st->index;
         st->start_time                   = 0;