aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/split.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-08-03 00:59:02 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-08-07 09:21:13 +0200
commit50ea7389ecae321ea6c4c585b8f721b84bd64a1d (patch)
tree87f92b2b059f2ca17392f5dceca05c14d1859934 /libavfilter/split.c
parent6b82f35041fd3229f056e9b8644e8a91d0e0bc19 (diff)
downloadffmpeg-50ea7389ecae321ea6c4c585b8f721b84bd64a1d.tar.gz
avfilter: Deduplicate default audio inputs/outputs
Lots of audio filters use very simple inputs or outputs: An array with a single AVFilterPad whose name is "default" and whose type is AVMEDIA_TYPE_AUDIO; everything else is unset. Given that we never use pointer equality for inputs or outputs*, we can simply use a single AVFilterPad instead of dozens; this even saves .data.rel.ro (4784B here) as well as relocations. *: In fact, several filters (like the filters in af_biquads.c) already use the same inputs; furthermore, ff_filter_alloc() duplicates the input and output pads so that we do not even work with the pads directly. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/split.c')
-rw-r--r--libavfilter/split.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/libavfilter/split.c b/libavfilter/split.c
index 2a511668e2..6f24af3f02 100644
--- a/libavfilter/split.c
+++ b/libavfilter/split.c
@@ -153,13 +153,6 @@ const AVFilter ff_vf_split = {
.flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS | AVFILTER_FLAG_METADATA_ONLY,
};
-static const AVFilterPad avfilter_af_asplit_inputs[] = {
- {
- .name = "default",
- .type = AVMEDIA_TYPE_AUDIO,
- },
-};
-
const AVFilter ff_af_asplit = {
.name = "asplit",
.description = NULL_IF_CONFIG_SMALL("Pass on the audio input to N audio outputs."),
@@ -167,7 +160,7 @@ const AVFilter ff_af_asplit = {
.priv_size = sizeof(SplitContext),
.init = split_init,
.activate = activate,
- FILTER_INPUTS(avfilter_af_asplit_inputs),
+ FILTER_INPUTS(ff_audio_default_filterpad),
.outputs = NULL,
.flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS | AVFILTER_FLAG_METADATA_ONLY,
};