From ebe8ba131fcd65f0d2bdadfd39c81dea352b2406 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 13 May 2019 11:11:26 +0200 Subject: [PATCH] svag: convert to new channel layout API Signed-off-by: James Almer --- libavformat/svag.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavformat/svag.c b/libavformat/svag.c index 0774eae112..45d04727fe 100644 --- a/libavformat/svag.c +++ b/libavformat/svag.c @@ -47,14 +47,15 @@ static int svag_read_header(AVFormatContext *s) st->codecpar->sample_rate = avio_rl32(s->pb); if (st->codecpar->sample_rate <= 0) return AVERROR_INVALIDDATA; - st->codecpar->channels = avio_rl32(s->pb); - if (st->codecpar->channels <= 0 || st->codecpar->channels > 8) + st->codecpar->ch_layout.nb_channels = avio_rl32(s->pb); + if (st->codecpar->ch_layout.nb_channels <= 0 || + st->codecpar->ch_layout.nb_channels > 8) return AVERROR_INVALIDDATA; - st->duration = size / (16 * st->codecpar->channels) * 28; + st->duration = size / (16 * st->codecpar->ch_layout.nb_channels) * 28; align = avio_rl32(s->pb); - if (align <= 0 || align > INT_MAX / st->codecpar->channels) + if (align <= 0 || align > INT_MAX / st->codecpar->ch_layout.nb_channels) return AVERROR_INVALIDDATA; - st->codecpar->block_align = align * st->codecpar->channels; + st->codecpar->block_align = align * st->codecpar->ch_layout.nb_channels; avio_skip(s->pb, 0x800 - avio_tell(s->pb)); avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);