Commit 98663a0b authored by Jun Zhao's avatar Jun Zhao

lavfi/lensfun: 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 ecc09651
...@@ -465,7 +465,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) ...@@ -465,7 +465,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
vignetting_filter_slice, vignetting_filter_slice,
&vignetting_thread_data, &vignetting_thread_data,
NULL, NULL,
FFMIN(outlink->h, ctx->graph->nb_threads)); FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
} }
if (lensfun->mode & (GEOMETRY_DISTORTION | SUBPIXEL_DISTORTION)) { if (lensfun->mode & (GEOMETRY_DISTORTION | SUBPIXEL_DISTORTION)) {
...@@ -493,7 +493,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) ...@@ -493,7 +493,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
distortion_correction_filter_slice, distortion_correction_filter_slice,
&distortion_correction_thread_data, &distortion_correction_thread_data,
NULL, NULL,
FFMIN(outlink->h, ctx->graph->nb_threads)); FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
av_frame_free(&in); av_frame_free(&in);
return ff_filter_frame(outlink, out); return ff_filter_frame(outlink, out);
......
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