Skip to content

Commit a1aec77

Browse files
committed
avfilter/avfiltergraph: Avoid indirection when freeing filtergraph
Signed-off-by: Andreas Rheinhardt <[email protected]>
1 parent a272c9c commit a1aec77

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

libavfilter/avfiltergraph.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,25 @@ void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter
116116
}
117117
}
118118

119-
void avfilter_graph_free(AVFilterGraph **graph)
119+
void avfilter_graph_free(AVFilterGraph **graphp)
120120
{
121-
if (!*graph)
121+
AVFilterGraph *graph = *graphp;
122+
123+
if (!graph)
122124
return;
123125

124-
while ((*graph)->nb_filters)
125-
avfilter_free((*graph)->filters[0]);
126+
while (graph->nb_filters)
127+
avfilter_free(graph->filters[0]);
126128

127-
ff_graph_thread_free(*graph);
129+
ff_graph_thread_free(graph);
128130

129-
av_freep(&(*graph)->sink_links);
131+
av_freep(&graph->sink_links);
130132

131-
av_opt_free(*graph);
133+
av_opt_free(graph);
132134

133-
av_freep(&(*graph)->filters);
134-
av_freep(&(*graph)->internal);
135-
av_freep(graph);
135+
av_freep(&graph->filters);
136+
av_freep(&graph->internal);
137+
av_freep(graphp);
136138
}
137139

138140
int avfilter_graph_create_filter(AVFilterContext **filt_ctx, const AVFilter *filt,

0 commit comments

Comments
 (0)