mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-02-04 14:30:55 +08:00
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>
This commit is contained in:
@@ -300,13 +300,6 @@ static const AVFilterPad ainputs[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static const AVFilterPad aoutputs[] = {
|
||||
{
|
||||
.name = "default",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
},
|
||||
};
|
||||
|
||||
const AVFilter ff_af_aloop = {
|
||||
.name = "aloop",
|
||||
.description = NULL_IF_CONFIG_SMALL("Loop audio samples."),
|
||||
@@ -315,7 +308,7 @@ const AVFilter ff_af_aloop = {
|
||||
.activate = aactivate,
|
||||
.uninit = auninit,
|
||||
FILTER_INPUTS(ainputs),
|
||||
FILTER_OUTPUTS(aoutputs),
|
||||
FILTER_OUTPUTS(ff_audio_default_filterpad),
|
||||
};
|
||||
#endif /* CONFIG_ALOOP_FILTER */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user