aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-06-04 17:16:02 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:46 -0300
commit5636972c7acb5a485e1759db478ded70ee9d3832 (patch)
tree2cf11628c865339e88d00bc166c7a229ce931b6f /libavcodec
parentbfe86a761a969190ad93781ac5126e8c1742300f (diff)
downloadffmpeg-5636972c7acb5a485e1759db478ded70ee9d3832.tar.gz
lavc: drop temporary compat wrappers for channel layout API change
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/aacdec_template.c7
-rw-r--r--libavcodec/avcodec.c29
-rw-r--r--libavcodec/dca_lbr.c7
-rw-r--r--libavcodec/dcadec.c8
-rw-r--r--libavcodec/decode.c20
-rw-r--r--libavcodec/encode.c17
6 files changed, 1 insertions, 87 deletions
diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index 387a4acfce..349ecdefb3 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -592,13 +592,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
av_channel_layout_copy(&avctx->ch_layout, &ac->oc[1].ch_layout);
-#if FF_API_OLD_CHANNEL_LAYOUT
-FF_DISABLE_DEPRECATION_WARNINGS
- 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
ac->oc[1].status = oc_type;
if (get_new_frame) {
diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index f3bbbbd722..df26c16c90 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -137,8 +137,6 @@ static int64_t get_bit_rate(AVCodecContext *ctx)
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
{
int ret = 0;
- int orig_channels;
- uint64_t orig_channel_layout;
AVCodecInternal *avci;
if (avcodec_is_open(avctx))
@@ -275,14 +273,6 @@ FF_DISABLE_DEPRECATION_WARNINGS
avctx->ch_layout.nb_channels = avctx->channels;
}
}
-
- /* temporary compat wrapper for new-style callers and old-style codecs;
- * to be removed once all the codecs have been converted */
- if (avctx->ch_layout.nb_channels) {
- 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
@@ -346,13 +336,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (!HAVE_THREADS && !(codec->caps_internal & FF_CODEC_CAP_AUTO_THREADS))
avctx->thread_count = 1;
-#if FF_API_OLD_CHANNEL_LAYOUT
-FF_DISABLE_DEPRECATION_WARNINGS
- orig_channels = avctx->channels;
- orig_channel_layout = avctx->channel_layout;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
if (!(avctx->active_thread_type & FF_THREAD_FRAME) ||
avci->frame_thread_encoder) {
if (avctx->codec->init) {
@@ -375,18 +358,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
#if FF_API_OLD_CHANNEL_LAYOUT
FF_DISABLE_DEPRECATION_WARNINGS
- /* decoder setting the old-style fields */
- if (avctx->channels != orig_channels ||
- avctx->channel_layout != orig_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;
- }
- }
-
/* 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 ?
diff --git a/libavcodec/dca_lbr.c b/libavcodec/dca_lbr.c
index a364672639..68f822ecfa 100644
--- a/libavcodec/dca_lbr.c
+++ b/libavcodec/dca_lbr.c
@@ -1745,13 +1745,6 @@ int ff_dca_lbr_filter_frame(DCALbrDecoder *s, AVFrame *frame)
av_channel_layout_uninit(&avctx->ch_layout);
av_channel_layout_from_mask(&avctx->ch_layout, channel_mask);
-#if FF_API_OLD_CHANNEL_LAYOUT
-FF_DISABLE_DEPRECATION_WARNINGS
- 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
frame->nb_samples = 1024 << s->freq_range;
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index 3fc9b35699..ad56554f46 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -79,14 +79,6 @@ int ff_dca_set_channel_layout(AVCodecContext *avctx, int *ch_remap, int dca_mask
av_channel_layout_from_mask(&avctx->ch_layout, wav_mask);
}
-#if FF_API_OLD_CHANNEL_LAYOUT
-FF_DISABLE_DEPRECATION_WARNINGS
- 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
-
return nchannels;
}
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index a22fc2c574..ca7e5872fb 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1701,26 +1701,6 @@ int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
} else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
#if FF_API_OLD_CHANNEL_LAYOUT
FF_DISABLE_DEPRECATION_WARNINGS
- /* temporary compat layer for decoders setting the old-style channel
- * layout fields; shall be removed after all the decoders are converted
- * to the new API */
- if ((avctx->channels > 0 && 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) {
- if (av_popcount64(avctx->channel_layout) != avctx->channels) {
- av_log(avctx, AV_LOG_ERROR, "Inconsistent channel layout/channels\n");
- ret = AVERROR(EINVAL);
- goto fail;
- }
- 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;
- }
- }
-
/* compat layer for old-style get_buffer() implementations */
avctx->channels = avctx->ch_layout.nb_channels;
avctx->channel_layout = (avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE) ?
diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index f9f8879b8e..47fa3ac4bf 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -486,24 +486,9 @@ int ff_encode_preinit(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "Specified channel layout '%s' is not supported\n", buf);
return AVERROR(EINVAL);
}
-FF_DISABLE_DEPRECATION_WARNINGS
}
#if FF_API_OLD_CHANNEL_LAYOUT
- else if (avctx->codec->channel_layouts) {
- if (!avctx->channel_layout) {
- av_log(avctx, AV_LOG_WARNING, "Channel layout not specified\n");
- } else {
- for (i = 0; avctx->codec->channel_layouts[i] != 0; i++)
- if (avctx->channel_layout == avctx->codec->channel_layouts[i])
- break;
- if (avctx->codec->channel_layouts[i] == 0) {
- char buf[512];
- av_get_channel_layout_string(buf, sizeof(buf), -1, avctx->channel_layout);
- av_log(avctx, AV_LOG_ERROR, "Specified channel layout '%s' is not supported\n", buf);
- return AVERROR(EINVAL);
- }
- }
- }
+FF_DISABLE_DEPRECATION_WARNINGS
if (avctx->channel_layout && avctx->channels) {
int channels = av_get_channel_layout_nb_channels(avctx->channel_layout);
if (channels != avctx->channels) {