[FFmpeg-cvslog] avfilter/af_afir: no need to dynamically add outpad

Paul B Mahol git at videolan.org
Mon Nov 20 00:56:53 EET 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Nov 19 23:53:02 2023 +0100| [28a43cf7feac6c96017b29626eb46d946aebbbe6] | committer: Paul B Mahol

avfilter/af_afir: no need to dynamically add outpad

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=28a43cf7feac6c96017b29626eb46d946aebbbe6
---

 libavfilter/af_afir.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c
index 7d670ddff2..6263734baa 100644
--- a/libavfilter/af_afir.c
+++ b/libavfilter/af_afir.c
@@ -616,16 +616,6 @@ static av_cold int init(AVFilterContext *ctx)
             return ret;
     }
 
-    pad = (AVFilterPad) {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_AUDIO,
-        .config_props  = config_output,
-    };
-
-    ret = ff_append_outpad(ctx, &pad);
-    if (ret < 0)
-        return ret;
-
     s->fdsp = avpriv_float_dsp_alloc(0);
     if (!s->fdsp)
         return AVERROR(ENOMEM);
@@ -707,12 +697,21 @@ static const AVOption afir_options[] = {
 
 AVFILTER_DEFINE_CLASS(afir);
 
+static const AVFilterPad outputs[] = {
+    {
+        .name         = "default",
+        .type         = AVMEDIA_TYPE_AUDIO,
+        .config_props = config_output,
+    },
+};
+
 const AVFilter ff_af_afir = {
     .name          = "afir",
     .description   = NULL_IF_CONFIG_SMALL("Apply Finite Impulse Response filter with supplied coefficients in additional stream(s)."),
     .priv_size     = sizeof(AudioFIRContext),
     .priv_class    = &afir_class,
     FILTER_QUERY_FUNC(query_formats),
+    FILTER_OUTPUTS(outputs),
     .init          = init,
     .activate      = activate,
     .uninit        = uninit,



More information about the ffmpeg-cvslog mailing list