mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
svag: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
84aee1dc1e
commit
ebe8ba131f
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user