Browse Source

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: Steven Liu <lq@onvideo.cn>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
tags/n4.2
Jun Zhao 6 years ago
parent
commit
98663a0bb8
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavfilter/vf_lensfun.c

+ 2
- 2
libavfilter/vf_lensfun.c View File

@@ -465,7 +465,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
vignetting_filter_slice,
&vignetting_thread_data,
NULL,
FFMIN(outlink->h, ctx->graph->nb_threads));
FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
}

if (lensfun->mode & (GEOMETRY_DISTORTION | SUBPIXEL_DISTORTION)) {
@@ -493,7 +493,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
distortion_correction_filter_slice,
&distortion_correction_thread_data,
NULL,
FFMIN(outlink->h, ctx->graph->nb_threads));
FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));

av_frame_free(&in);
return ff_filter_frame(outlink, out);


Loading…
Cancel
Save