aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/f_graphmonitor.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/f_graphmonitor.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/f_graphmonitor.c')
-rw-r--r--libavfilter/f_graphmonitor.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/libavfilter/f_graphmonitor.c b/libavfilter/f_graphmonitor.c
index 3a2760ed8c..e75cc52fbe 100644
--- a/libavfilter/f_graphmonitor.c
+++ b/libavfilter/f_graphmonitor.c
@@ -28,6 +28,7 @@
#include "libavutil/opt.h"
#include "libavutil/timestamp.h"
#include "libavutil/xga_font_data.h"
+#include "audio.h"
#include "avfilter.h"
#include "filters.h"
#include "formats.h"
@@ -602,13 +603,6 @@ const AVFilter ff_vf_graphmonitor = {
#if CONFIG_AGRAPHMONITOR_FILTER
-static const AVFilterPad agraphmonitor_inputs[] = {
- {
- .name = "default",
- .type = AVMEDIA_TYPE_AUDIO,
- },
-};
-
static const AVFilterPad agraphmonitor_outputs[] = {
{
.name = "default",
@@ -625,7 +619,7 @@ const AVFilter ff_avf_agraphmonitor = {
.init = init,
.uninit = uninit,
.activate = activate,
- FILTER_INPUTS(agraphmonitor_inputs),
+ FILTER_INPUTS(ff_audio_default_filterpad),
FILTER_OUTPUTS(agraphmonitor_outputs),
FILTER_QUERY_FUNC(query_formats),
.process_command = ff_filter_process_command,