diff mbox series

[FFmpeg-devel,013/279] ace: convert to new channel layout API

Message ID 20211208010649.381-14-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
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/acedec.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/acedec.c b/libavformat/acedec.c
index a52a0f0e54..74128e0a6a 100644
--- a/libavformat/acedec.c
+++ b/libavformat/acedec.c
@@ -74,7 +74,8 @@  static int ace_read_header(AVFormatContext *s)
     st->start_time = 0;
     par = st->codecpar;
     par->codec_type  = AVMEDIA_TYPE_AUDIO;
-    par->channels    = nb_channels;
+    par->ch_layout.order       = AV_CHANNEL_ORDER_UNSPEC;
+    par->ch_layout.nb_channels = nb_channels;
     par->sample_rate = rate;
     par->block_align = (codec == 4 ? 0x60 : codec == 5 ? 0x98 : 0xC0) * nb_channels;
     st->duration     = (size / par->block_align) * 1024LL;
@@ -85,7 +86,7 @@  static int ace_read_header(AVFormatContext *s)
         return ret;
 
     AV_WL16(st->codecpar->extradata, 1);
-    AV_WL16(st->codecpar->extradata+2, 2048 * par->channels);
+    AV_WL16(st->codecpar->extradata+2, 2048 * nb_channels);
     AV_WL16(st->codecpar->extradata+4, 0);
     AV_WL16(st->codecpar->extradata+6, codec == 4 ? 1 : 0);
     AV_WL16(st->codecpar->extradata+8, codec == 4 ? 1 : 0);