aboutsummaryrefslogtreecommitdiffstats
path: root/libswresample/swresample_frame.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-01-20 12:26:08 -0300
committerJames Almer <jamrial@gmail.com>2024-03-07 08:53:30 -0300
commit65ddc74988245a01421a63c5cffa4d900c47117c (patch)
tree72bd32783aca75dff15c038cd0a69d724514b31c /libswresample/swresample_frame.c
parenta12cd3be98e8aba6e74274192ec6532988aa9444 (diff)
downloadffmpeg-65ddc74988245a01421a63c5cffa4d900c47117c.tar.gz
avutil: remove deprecated FF_API_OLD_CHANNEL_LAYOUT
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libswresample/swresample_frame.c')
-rw-r--r--libswresample/swresample_frame.c47
1 files changed, 1 insertions, 46 deletions
diff --git a/libswresample/swresample_frame.c b/libswresample/swresample_frame.c
index 8726ee58e9..52e942f9c6 100644
--- a/libswresample/swresample_frame.c
+++ b/libswresample/swresample_frame.c
@@ -32,15 +32,6 @@ int swr_config_frame(SwrContext *s, const AVFrame *out, const AVFrame *in)
swr_close(s);
if (in) {
-#if FF_API_OLD_CHANNEL_LAYOUT
-FF_DISABLE_DEPRECATION_WARNINGS
- // if the old/new fields are set inconsistently, prefer the old ones
- if ((in->channel_layout && (in->ch_layout.order != AV_CHANNEL_ORDER_NATIVE ||
- in->ch_layout.u.mask != in->channel_layout))) {
- av_channel_layout_from_mask(&ch_layout, in->channel_layout);
-FF_ENABLE_DEPRECATION_WARNINGS
- } else
-#endif
if ((ret = av_channel_layout_copy(&ch_layout, &in->ch_layout)) < 0)
goto fail;
if ((ret = av_opt_set_chlayout(s, "ichl", &ch_layout, 0)) < 0)
@@ -52,16 +43,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
if (out) {
-#if FF_API_OLD_CHANNEL_LAYOUT
-FF_DISABLE_DEPRECATION_WARNINGS
- // if the old/new fields are set inconsistently, prefer the old ones
- if ((out->channel_layout && (out->ch_layout.order != AV_CHANNEL_ORDER_NATIVE ||
- out->ch_layout.u.mask != out->channel_layout))) {
- av_channel_layout_uninit(&ch_layout);
- av_channel_layout_from_mask(&ch_layout, out->channel_layout);
-FF_ENABLE_DEPRECATION_WARNINGS
- } else
-#endif
if ((ret = av_channel_layout_copy(&ch_layout, &out->ch_layout)) < 0)
goto fail;
if ((ret = av_opt_set_chlayout(s, "ochl", &ch_layout, 0)) < 0)
@@ -87,15 +68,6 @@ static int config_changed(SwrContext *s,
int ret = 0, err;
if (in) {
-#if FF_API_OLD_CHANNEL_LAYOUT
-FF_DISABLE_DEPRECATION_WARNINGS
- // if the old/new fields are set inconsistently, prefer the old ones
- if ((in->channel_layout && (in->ch_layout.order != AV_CHANNEL_ORDER_NATIVE ||
- in->ch_layout.u.mask != in->channel_layout))) {
- av_channel_layout_from_mask(&ch_layout, in->channel_layout);
-FF_ENABLE_DEPRECATION_WARNINGS
- } else
-#endif
if ((err = av_channel_layout_copy(&ch_layout, &in->ch_layout)) < 0)
return err;
if (av_channel_layout_compare(&s->in_ch_layout, &ch_layout) ||
@@ -106,16 +78,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
if (out) {
-#if FF_API_OLD_CHANNEL_LAYOUT
-FF_DISABLE_DEPRECATION_WARNINGS
- // if the old/new fields are set inconsistently, prefer the old ones
- if ((out->channel_layout && (out->ch_layout.order != AV_CHANNEL_ORDER_NATIVE ||
- out->ch_layout.u.mask != out->channel_layout))) {
- av_channel_layout_uninit(&ch_layout);
- av_channel_layout_from_mask(&ch_layout, out->channel_layout);
-FF_ENABLE_DEPRECATION_WARNINGS
- } else
-#endif
if ((err = av_channel_layout_copy(&ch_layout, &out->ch_layout)) < 0)
return err;
if (av_channel_layout_compare(&s->out_ch_layout, &ch_layout) ||
@@ -169,14 +131,7 @@ static inline int available_samples(AVFrame *out)
if (av_sample_fmt_is_planar(out->format)) {
return samples;
} else {
- int channels;
-#if FF_API_OLD_CHANNEL_LAYOUT
-FF_DISABLE_DEPRECATION_WARNINGS
- channels = av_get_channel_layout_nb_channels(out->channel_layout);
-FF_ENABLE_DEPRECATION_WARNINGS
- if (!channels)
-#endif
- channels = out->ch_layout.nb_channels;
+ int channels = out->ch_layout.nb_channels;
return samples / channels;
}
}