}
#endif
-int avfilter_graph_create_filter(AVFilterContext **filt_ctx, AVFilter *filt,
+int avfilter_graph_create_filter(AVFilterContext **filt_ctx, const AVFilter *filt,
const char *name, const char *args, void *opaque,
AVFilterGraph *graph_ctx)
{
{
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;
+ }
}
}