diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2017-04-07 18:08:41 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-15 09:42:39 -0300 |
commit | 548aeb93834b8425c86d1ce60fddc1d41805724d (patch) | |
tree | 0e6f61649b3a70f407e225d247ba5ef0fe812a48 /libavcodec/utils.c | |
parent | b6746b74621798d9b6697cd7369ee41625b375df (diff) |
lavc: switch to the new channel layout API
Since the request_channel_layout is used only by a handful of codecs,
move the option to codec private contexts.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 643c90f1f1..fe2db93782 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -804,8 +804,16 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba, int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes) { - int duration = get_audio_frame_duration(avctx->codec_id, avctx->sample_rate, - avctx->channels, avctx->block_align, + int channels = avctx->ch_layout.nb_channels; + int duration; +#if FF_API_OLD_CHANNEL_LAYOUT +FF_DISABLE_DEPRECATION_WARNINGS + if (!channels) + channels = avctx->channels; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + duration = get_audio_frame_duration(avctx->codec_id, avctx->sample_rate, + channels, avctx->block_align, avctx->codec_tag, avctx->bits_per_coded_sample, avctx->bit_rate, avctx->extradata, avctx->frame_size, frame_bytes); |