1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

boa: convert to new channel layout API

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
Anton Khirnov 2019-05-13 11:11:26 +02:00 committed by James Almer
parent 96b64bd948
commit 8269fbcb7a

View File

@ -55,15 +55,16 @@ static int read_header(AVFormatContext *s)
avio_rl32(s->pb);
avio_rl32(s->pb);
st->codecpar->sample_rate = avio_rl32(s->pb);
st->codecpar->channels = avio_rl32(s->pb);
if (st->codecpar->channels > FF_SANE_NB_CHANNELS || st->codecpar->channels <= 0)
st->codecpar->ch_layout.nb_channels = avio_rl32(s->pb);
if (st->codecpar->ch_layout.nb_channels > FF_SANE_NB_CHANNELS ||
st->codecpar->ch_layout.order <= 0)
return AVERROR(ENOSYS);
ffformatcontext(s)->data_offset = data_offset = avio_rl32(s->pb);
avio_r8(s->pb);
st->codecpar->block_align = avio_rl32(s->pb);
if (st->codecpar->block_align > INT_MAX / FF_SANE_NB_CHANNELS || st->codecpar->block_align <= 0)
return AVERROR_INVALIDDATA;
st->codecpar->block_align *= st->codecpar->channels;
st->codecpar->block_align *= st->codecpar->ch_layout.nb_channels;
avio_seek(s->pb, data_offset, SEEK_SET);