summaryrefslogtreecommitdiff
path: root/libavfilter/avfiltergraph.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-08-08 16:28:41 +0200
committerAnton Khirnov <anton@khirnov.net>2013-09-28 08:06:19 +0200
commit0767bfd1994c4bf22e167ffadb8f823a950aad18 (patch)
treebdbf92d10ec581bb324cd245dcfc6e888dcaa12c /libavfilter/avfiltergraph.c
parent38e15df1489d86c016515223ee693e7d0326c56a (diff)
lavfi: allow user-provided execute() callbacks
Diffstat (limited to 'libavfilter/avfiltergraph.c')
-rw-r--r--libavfilter/avfiltergraph.c14
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;
+ }
}
}