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:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user