diff mbox series

[FFmpeg-devel,100/281] mpc8: convert to new channel layout API

Message ID 20220113015612.448-12-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 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:55 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/mpc8.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index 0cf46b36a0..c5f05e08a2 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -230,6 +230,7 @@  static int mpc8_read_header(AVFormatContext *s)
     AVIOContext *pb = s->pb;
     AVStream *st;
     int tag = 0, ret;
+    int channels;
     int64_t size, pos;
 
     c->header_pos = avio_tell(pb);
@@ -273,7 +274,9 @@  static int mpc8_read_header(AVFormatContext *s)
     if ((ret = ff_get_extradata(s, st->codecpar, pb, 2)) < 0)
         return ret;
 
-    st->codecpar->channels = (st->codecpar->extradata[1] >> 4) + 1;
+    channels = (st->codecpar->extradata[1] >> 4) + 1;
+    st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
+    st->codecpar->ch_layout.nb_channels = channels;
     st->codecpar->sample_rate = mpc8_rate[st->codecpar->extradata[0] >> 5];
     avpriv_set_pts_info(st, 64, 1152  << (st->codecpar->extradata[1]&3)*2, st->codecpar->sample_rate);
     st->start_time = 0;