mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-25 00:10:00 +01:00
avutil: remove deprecated FF_API_OLD_CHANNEL_LAYOUT
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -241,26 +241,6 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
|
||||
goto free_and_end;
|
||||
}
|
||||
|
||||
#if FF_API_OLD_CHANNEL_LAYOUT
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
/* compat wrapper for old-style callers */
|
||||
if (avctx->channel_layout && !avctx->channels)
|
||||
avctx->channels = av_popcount64(avctx->channel_layout);
|
||||
|
||||
if ((avctx->channels && avctx->ch_layout.nb_channels != avctx->channels) ||
|
||||
(avctx->channel_layout && (avctx->ch_layout.order != AV_CHANNEL_ORDER_NATIVE ||
|
||||
avctx->ch_layout.u.mask != avctx->channel_layout))) {
|
||||
av_channel_layout_uninit(&avctx->ch_layout);
|
||||
if (avctx->channel_layout) {
|
||||
av_channel_layout_from_mask(&avctx->ch_layout, avctx->channel_layout);
|
||||
} else {
|
||||
avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
|
||||
}
|
||||
avctx->ch_layout.nb_channels = avctx->channels;
|
||||
}
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
|
||||
/* AV_CODEC_CAP_CHANNEL_CONF is a decoder-only flag; so the code below
|
||||
* in particular checks that nb_channels is set for all audio encoders. */
|
||||
if (avctx->codec_type == AVMEDIA_TYPE_AUDIO && !avctx->ch_layout.nb_channels
|
||||
@@ -345,15 +325,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
if (!avctx->bit_rate)
|
||||
avctx->bit_rate = get_bit_rate(avctx);
|
||||
|
||||
#if FF_API_OLD_CHANNEL_LAYOUT
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
/* update the deprecated fields for old-style callers */
|
||||
avctx->channels = avctx->ch_layout.nb_channels;
|
||||
avctx->channel_layout = avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ?
|
||||
avctx->ch_layout.u.mask : 0;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
|
||||
/* validate channel layout from the decoder */
|
||||
if ((avctx->ch_layout.nb_channels && !av_channel_layout_check(&avctx->ch_layout)) ||
|
||||
avctx->ch_layout.nb_channels > FF_SANE_NB_CHANNELS) {
|
||||
|
||||
Reference in New Issue
Block a user