aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2017-03-31 14:22:32 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:33 -0300
commitfe078ff0ed7e0871cf615f5dff48829e273bc10d (patch)
tree650c13475ee43e25ff965da22bc302cddb43292d
parentef65e450d241b1a72b3b137fe50c920fa651b621 (diff)
downloadffmpeg-fe078ff0ed7e0871cf615f5dff48829e273bc10d.tar.gz
ipmovie: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/ipmovie.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index 9c996d4a98..793f1f6fee 100644
--- a/libavformat/ipmovie.c
+++ b/libavformat/ipmovie.c
@@ -254,16 +254,14 @@ static int init_audio(AVFormatContext *s)
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
st->codecpar->codec_id = ipmovie->audio_type;
st->codecpar->codec_tag = 0; /* no tag */
- st->codecpar->channels = ipmovie->audio_channels;
- st->codecpar->channel_layout = st->codecpar->channels == 1 ? AV_CH_LAYOUT_MONO :
- AV_CH_LAYOUT_STEREO;
+ av_channel_layout_default(&st->codecpar->ch_layout, ipmovie->audio_channels);
st->codecpar->sample_rate = ipmovie->audio_sample_rate;
st->codecpar->bits_per_coded_sample = ipmovie->audio_bits;
- st->codecpar->bit_rate = st->codecpar->channels * st->codecpar->sample_rate *
+ st->codecpar->bit_rate = ipmovie->audio_channels * st->codecpar->sample_rate *
st->codecpar->bits_per_coded_sample;
if (st->codecpar->codec_id == AV_CODEC_ID_INTERPLAY_DPCM)
st->codecpar->bit_rate /= 2;
- st->codecpar->block_align = st->codecpar->channels * st->codecpar->bits_per_coded_sample;
+ st->codecpar->block_align = ipmovie->audio_channels * st->codecpar->bits_per_coded_sample;
return 0;
}