lavfi: allow user-provided execute() callbacks

This commit is contained in:
Anton Khirnov
2013-08-08 16:28:41 +02:00
parent 38e15df148
commit 0767bfd199
8 changed files with 69 additions and 15 deletions

View File

@@ -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;
}
}
}