avutil: remove deprecated FF_API_OLD_CHANNEL_LAYOUT

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2024-01-20 12:26:08 -03:00
parent a12cd3be98
commit 65ddc74988
100 changed files with 20 additions and 1792 deletions

View File

@@ -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) {