This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 52c84b06d5 avfilter/f_sidedata: also handle global side data in filter 
links
52c84b06d5 is described below

commit 52c84b06d59d50de6844e75fa06ee50a23fb717a
Author:     James Almer <[email protected]>
AuthorDate: Mon Dec 1 11:07:43 2025 -0300
Commit:     James Almer <[email protected]>
CommitDate: Thu Dec 4 13:50:45 2025 -0300

    avfilter/f_sidedata: also handle global side data in filter links
    
    Should fix issue #21071
    
    Signed-off-by: James Almer <[email protected]>
---
 libavfilter/f_sidedata.c | 47 +++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 43 insertions(+), 4 deletions(-)

diff --git a/libavfilter/f_sidedata.c b/libavfilter/f_sidedata.c
index b88a8cbd02..161fd2b9a2 100644
--- a/libavfilter/f_sidedata.c
+++ b/libavfilter/f_sidedata.c
@@ -27,10 +27,8 @@
 #include "libavutil/internal.h"
 #include "libavutil/frame.h"
 #include "libavutil/opt.h"
-#include "audio.h"
 #include "avfilter.h"
 #include "filters.h"
-#include "video.h"
 
 enum SideDataMode {
     SIDEDATA_SELECT,
@@ -96,6 +94,31 @@ static av_cold int init(AVFilterContext *ctx)
     return 0;
 }
 
+static int config_props(AVFilterLink *outlink)
+{
+    AVFilterContext *ctx = outlink->src;
+    SideDataContext *s = ctx->priv;
+    const AVFrameSideData *sd = NULL;
+
+    if (s->type != -1)
+       sd = av_frame_side_data_get(outlink->side_data, outlink->nb_side_data, 
s->type);
+
+    switch (s->mode) {
+    case SIDEDATA_SELECT:
+        break;
+    case SIDEDATA_DELETE:
+        if (s->type == -1)
+            av_frame_side_data_free(&outlink->side_data, 
&outlink->nb_side_data);
+        else if (sd)
+            av_frame_side_data_remove(&outlink->side_data, 
&outlink->nb_side_data, s->type);
+        break;
+    default:
+        av_assert0(0);
+    };
+
+    return 0;
+}
+
 static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
 {
     AVFilterContext *ctx = inlink->dst;
@@ -143,6 +166,14 @@ static const AVFilterPad ainputs[] = {
     },
 };
 
+static const AVFilterPad aoutputs[] = {
+    {
+        .name         = "default",
+        .type         = AVMEDIA_TYPE_AUDIO,
+        .config_props = config_props,
+    },
+};
+
 const FFFilter ff_af_asidedata = {
     .p.name        = "asidedata",
     .p.description = NULL_IF_CONFIG_SMALL("Manipulate audio frame side data."),
@@ -152,7 +183,7 @@ const FFFilter ff_af_asidedata = {
     .priv_size     = sizeof(SideDataContext),
     .init          = init,
     FILTER_INPUTS(ainputs),
-    FILTER_OUTPUTS(ff_audio_default_filterpad),
+    FILTER_OUTPUTS(aoutputs),
 };
 #endif /* CONFIG_ASIDEDATA_FILTER */
 
@@ -169,6 +200,14 @@ static const AVFilterPad inputs[] = {
     },
 };
 
+static const AVFilterPad outputs[] = {
+    {
+        .name         = "default",
+        .type         = AVMEDIA_TYPE_VIDEO,
+        .config_props = config_props,
+    },
+};
+
 const FFFilter ff_vf_sidedata = {
     .p.name        = "sidedata",
     .p.description = NULL_IF_CONFIG_SMALL("Manipulate video frame side data."),
@@ -178,6 +217,6 @@ const FFFilter ff_vf_sidedata = {
     .priv_size   = sizeof(SideDataContext),
     .init        = init,
     FILTER_INPUTS(inputs),
-    FILTER_OUTPUTS(ff_video_default_filterpad),
+    FILTER_OUTPUTS(outputs),
 };
 #endif /* CONFIG_SIDEDATA_FILTER */

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to