diff mbox series

[FFmpeg-devel,012/279] aax: convert to new channel layout API

Message ID 20211208010649.381-13-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/aaxdec.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/aaxdec.c b/libavformat/aaxdec.c
index b08ee036ed..8eb2540407 100644
--- a/libavformat/aaxdec.c
+++ b/libavformat/aaxdec.c
@@ -279,9 +279,10 @@  static int aax_read_header(AVFormatContext *s)
         ret = ff_get_extradata(s, par, pb, extradata_size);
         if (ret < 0)
             return ret;
-        par->channels    = AV_RB8 (par->extradata + 7);
+        par->ch_layout.order       = AV_CHANNEL_ORDER_UNSPEC;
+        par->ch_layout.nb_channels = AV_RB8 (par->extradata + 7);
         par->sample_rate = AV_RB32(par->extradata + 8);
-        if (!par->channels || !par->sample_rate)
+        if (!par->ch_layout.nb_channels || !par->sample_rate)
             return AVERROR_INVALIDDATA;
 
         avpriv_set_pts_info(st, 64, 32, par->sample_rate);
@@ -299,7 +300,7 @@  static int aax_read_packet(AVFormatContext *s, AVPacket *pkt)
     AAXContext *a = s->priv_data;
     AVCodecParameters *par = s->streams[0]->codecpar;
     AVIOContext *pb = s->pb;
-    const int size = 18 * par->channels;
+    const int size = 18 * par->ch_layout.nb_channels;
     int ret, extradata_size = 0;
     uint8_t *extradata = NULL;
     int skip = 0;