diff mbox series

[FFmpeg-devel,068/281] gdv: convert to new channel layout API

Message ID 20220113015101.4-69-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_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished
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
From: Anton Khirnov <anton@khirnov.net>

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/gdv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/gdv.c b/libavformat/gdv.c
index b20691a2a4..f2e0748b6b 100644
--- a/libavformat/gdv.c
+++ b/libavformat/gdv.c
@@ -99,7 +99,8 @@  static int gdv_read_header(AVFormatContext *ctx)
         ast->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;
         ast->codecpar->codec_tag   = 0;
         ast->codecpar->sample_rate = avio_rl16(pb);
-        ast->codecpar->channels    = 1 + !!(snd_flags & 2);
+        ast->codecpar->ch_layout.order       = AV_CHANNEL_ORDER_UNSPEC;
+        ast->codecpar->ch_layout.nb_channels = 1 + !!(snd_flags & 2);
         if (snd_flags & 8) {
             ast->codecpar->codec_id = AV_CODEC_ID_GREMLIN_DPCM;
         } else {
@@ -108,7 +109,8 @@  static int gdv_read_header(AVFormatContext *ctx)
 
         avpriv_set_pts_info(ast, 64, 1, ast->codecpar->sample_rate);
         gdv->audio_size = (ast->codecpar->sample_rate / fps) *
-                           ast->codecpar->channels * (1 + !!(snd_flags & 4)) / (1 + !!(snd_flags & 8));
+                           ast->codecpar->ch_layout.nb_channels *
+                           (1 + !!(snd_flags & 4)) / (1 + !!(snd_flags & 8));
         gdv->is_audio = 1;
     } else {
         avio_skip(pb, 2);