diff mbox series

[FFmpeg-devel,063/281] fwse: convert to new channel layout API

Message ID 20220113015101.4-64-jamrial@gmail.com
State Accepted
Commit 7261f2a180d94f6660f3f36eb7917b6f64b67d0d
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_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson fail Make fate failed
andriy/make_ppc success Make finished
andriy/make_fate_ppc fail Make fate failed

Commit Message

James Almer Jan. 13, 2022, 1:50 a.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/fwse.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/fwse.c b/libavformat/fwse.c
index ed8cd3a6db..28a322d9d6 100644
--- a/libavformat/fwse.c
+++ b/libavformat/fwse.c
@@ -40,6 +40,7 @@  static int fwse_probe(const AVProbeData *p)
 static int fwse_read_header(AVFormatContext *s)
 {
     unsigned start_offset, version;
+    int channels;
     AVIOContext *pb = s->pb;
     AVCodecParameters *par;
     AVStream *st;
@@ -59,13 +60,10 @@  static int fwse_read_header(AVFormatContext *s)
     par->codec_type  = AVMEDIA_TYPE_AUDIO;
     par->codec_id    = AV_CODEC_ID_ADPCM_IMA_MTF;
     par->format      = AV_SAMPLE_FMT_S16;
-    par->channels    = avio_rl32(pb);
-    if (par->channels != 1 && par->channels != 2)
+    channels         = avio_rl32(pb);
+    if (channels != 1 && channels != 2)
         return AVERROR_INVALIDDATA;
-    if (par->channels == 1)
-        par->channel_layout = AV_CH_LAYOUT_MONO;
-    else if (par->channels == 2)
-        par->channel_layout = AV_CH_LAYOUT_STEREO;
+    av_channel_layout_default(&par->ch_layout, channels);
     st->duration = avio_rl32(pb);
     par->sample_rate = avio_rl32(pb);
     if (par->sample_rate <= 0 || par->sample_rate > INT_MAX)