Commit 82ccb9cb authored by Jun Zhao's avatar Jun Zhao

doc/writing_filters: Use ff_filter_get_nb_threads() get number of threads

ff_filter_get_nb_threads() respect AVFilterContext.nb_threads and
graph->nb_threads both, in most case, we perfer this API than using
ctx->graph->nb_threads directly.
Reviewed-by: 's avatarSteven Liu <lq@onvideo.cn>
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarJun Zhao <barryjzhao@tencent.com>
parent 98663a0b
...@@ -389,7 +389,7 @@ distributor with something like this: ...@@ -389,7 +389,7 @@ distributor with something like this:
td.in = in; td.in = in;
td.out = out; td.out = out;
ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, ctx->graph->nb_threads)); ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
// ... // ...
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment