From 0767bfd1994c4bf22e167ffadb8f823a950aad18 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 8 Aug 2013 16:28:41 +0200 Subject: lavfi: allow user-provided execute() callbacks --- libavfilter/avfiltergraph.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'libavfilter/avfiltergraph.c') diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index de827355b8..0fc385c3a6 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -168,11 +168,15 @@ AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph, { AVFilterContext **filters, *s; - if (graph->thread_type && !graph->internal->thread) { - int ret = ff_graph_thread_init(graph); - if (ret < 0) { - av_log(graph, AV_LOG_ERROR, "Error initializing threading.\n"); - return NULL; + if (graph->thread_type && !graph->internal->thread_execute) { + if (graph->execute) { + graph->internal->thread_execute = graph->execute; + } else { + int ret = ff_graph_thread_init(graph); + if (ret < 0) { + av_log(graph, AV_LOG_ERROR, "Error initializing threading.\n"); + return NULL; + } } } -- cgit v1.2.3