diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-08-08 18:28:41 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-09-28 10:06:19 +0400 |
commit | 0767bfd1994c4bf22e167ffadb8f823a950aad18 (patch) | |
tree | bdbf92d10ec581bb324cd245dcfc6e888dcaa12c /libavfilter/avfiltergraph.c | |
parent | 38e15df1489d86c016515223ee693e7d0326c56a (diff) |
lavfi: allow user-provided execute() callbacks
Diffstat (limited to 'libavfilter/avfiltergraph.c')
-rw-r--r-- | libavfilter/avfiltergraph.c | 14 |
1 files changed, 9 insertions, 5 deletions
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; + } } } |