From 50ea7389ecae321ea6c4c585b8f721b84bd64a1d Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Thu, 3 Aug 2023 00:59:02 +0200 Subject: 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 --- libavfilter/af_ashowinfo.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'libavfilter/af_ashowinfo.c') diff --git a/libavfilter/af_ashowinfo.c b/libavfilter/af_ashowinfo.c index 20900369d0..17a0a90542 100644 --- a/libavfilter/af_ashowinfo.c +++ b/libavfilter/af_ashowinfo.c @@ -253,13 +253,6 @@ static const AVFilterPad inputs[] = { }, }; -static const AVFilterPad outputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_AUDIO, - }, -}; - const AVFilter ff_af_ashowinfo = { .name = "ashowinfo", .description = NULL_IF_CONFIG_SMALL("Show textual information for each audio frame."), @@ -267,5 +260,5 @@ const AVFilter ff_af_ashowinfo = { .uninit = uninit, .flags = AVFILTER_FLAG_METADATA_ONLY, FILTER_INPUTS(inputs), - FILTER_OUTPUTS(outputs), + FILTER_OUTPUTS(ff_audio_default_filterpad), }; -- cgit v1.2.3