summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-02-10 17:43:52 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-02-18 16:38:09 +0100
commita1aec776f13bd865a9b80446d33a796acb607db3 (patch)
treefe885dff686c8ff3d10e64605f24d1b1ce771910
parenta272c9cffa524434d32e194e9132afa0c83f6c0d (diff)
avfilter/avfiltergraph: Avoid indirection when freeing filtergraph
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavfilter/avfiltergraph.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 6e5e3e58f1..212d29f5f8 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -116,23 +116,25 @@ void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter
}
}
-void avfilter_graph_free(AVFilterGraph **graph)
+void avfilter_graph_free(AVFilterGraph **graphp)
{
- if (!*graph)
+ AVFilterGraph *graph = *graphp;
+
+ if (!graph)
return;
- while ((*graph)->nb_filters)
- avfilter_free((*graph)->filters[0]);
+ while (graph->nb_filters)
+ avfilter_free(graph->filters[0]);
- ff_graph_thread_free(*graph);
+ ff_graph_thread_free(graph);
- av_freep(&(*graph)->sink_links);
+ av_freep(&graph->sink_links);
- av_opt_free(*graph);
+ av_opt_free(graph);
- av_freep(&(*graph)->filters);
- av_freep(&(*graph)->internal);
- av_freep(graph);
+ av_freep(&graph->filters);
+ av_freep(&graph->internal);
+ av_freep(graphp);
}
int avfilter_graph_create_filter(AVFilterContext **filt_ctx, const AVFilter *filt,