diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2017-03-31 13:25:52 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-15 09:42:30 -0300 |
commit | 333a48d6174ca7cb2ba71f248c326db93c3ff342 (patch) | |
tree | 573ac70b8df793e43ae2897e970325368a9b7293 /libavformat | |
parent | 5e9dd31e2dd1f48ee9738ab453662a4797894044 (diff) | |
download | ffmpeg-333a48d6174ca7cb2ba71f248c326db93c3ff342.tar.gz |
aea: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/aea.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libavformat/aea.c b/libavformat/aea.c index 14d0840cf3..f4b39e4f9e 100644 --- a/libavformat/aea.c +++ b/libavformat/aea.c @@ -62,12 +62,13 @@ static int aea_read_probe(const AVProbeData *p) static int aea_read_header(AVFormatContext *s) { AVStream *st = avformat_new_stream(s, NULL); + int channels; if (!st) return AVERROR(ENOMEM); /* Parse the amount of channels and skip to pos 2048(0x800) */ avio_skip(s->pb, 264); - st->codecpar->channels = avio_r8(s->pb); + channels = avio_r8(s->pb); avio_skip(s->pb, 1783); @@ -76,14 +77,14 @@ static int aea_read_header(AVFormatContext *s) st->codecpar->sample_rate = 44100; st->codecpar->bit_rate = 292000; - if (st->codecpar->channels != 1 && st->codecpar->channels != 2) { - av_log(s, AV_LOG_ERROR, "Channels %d not supported!\n", st->codecpar->channels); + if (channels != 1 && channels != 2) { + av_log(s, AV_LOG_ERROR, "Channels %d not supported!\n", channels); return AVERROR_INVALIDDATA; } - st->codecpar->channel_layout = (st->codecpar->channels == 1) ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO; + av_channel_layout_default(&st->codecpar->ch_layout, channels); - st->codecpar->block_align = AT1_SU_SIZE * st->codecpar->channels; + st->codecpar->block_align = AT1_SU_SIZE * st->codecpar->ch_layout.nb_channels; return 0; } |