diff options
author | Anton Khirnov <anton@khirnov.net> | 2019-05-13 11:11:26 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-15 09:42:37 -0300 |
commit | ebe8ba131fcd65f0d2bdadfd39c81dea352b2406 (patch) | |
tree | 76af7d429d33f39c3de8ca0b776be759136c7018 /libavformat | |
parent | 84aee1dc1eef0154e8adfdadf3735f78a63379e8 (diff) | |
download | ffmpeg-ebe8ba131fcd65f0d2bdadfd39c81dea352b2406.tar.gz |
svag: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/svag.c | 11 |
1 files 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); |