]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/avfiltergraph.c
Merge commit 'a66aa0daf290ef157cb3322b034b43d6201c43e9'
[ffmpeg] / libavfilter / avfiltergraph.c
index fb78a87de36d9080649e5485c37e02f46947330a..476391cf122e628a13ae7d082d2921bfca14947d 100644 (file)
@@ -182,11 +182,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;
+            }
         }
     }