[FFmpeg-cvslog] lavfi: set AVFilterLink.graph on link creation

Anton Khirnov git at videolan.org
Thu Aug 15 20:44:15 EEST 2024


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Aug  2 13:55:21 2024 +0200| [426e33c75853c395b39e216e7ecde0103ff48086] | committer: Anton Khirnov

lavfi: set AVFilterLink.graph on link creation

There is no reason to delay this.

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

 libavfilter/avfilter.c      | 1 +
 libavfilter/avfiltergraph.c | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 2dc8820184..c4bd134fb2 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -185,6 +185,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
     link->srcpad  = &src->output_pads[srcpad];
     link->dstpad  = &dst->input_pads[dstpad];
     link->type    = src->output_pads[srcpad].type;
+    link->graph   = src->graph;
     av_assert0(AV_PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1);
     link->format  = -1;
     link->colorspace = AVCOL_SPC_UNSPECIFIED;
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index bd3bed9a35..2791ffa64a 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -1208,11 +1208,9 @@ static int graph_config_pointers(AVFilterGraph *graph, void *log_ctx)
     for (i = 0; i < graph->nb_filters; i++) {
         f = graph->filters[i];
         for (j = 0; j < f->nb_inputs; j++) {
-            f->inputs[j]->graph     = graph;
             ff_link_internal(f->inputs[j])->age_index  = -1;
         }
         for (j = 0; j < f->nb_outputs; j++) {
-            f->outputs[j]->graph    = graph;
             ff_link_internal(f->outputs[j])->age_index = -1;
         }
         if (!f->nb_outputs) {



More information about the ffmpeg-cvslog mailing list