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.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -465,7 +465,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 464 unmodified lines | |||
| 465 | vignetting_filter_slice, | 465 | vignetting_filter_slice, |
| 466 | &vignetting_thread_data, | 466 | &vignetting_thread_data, |
| 467 | NULL, | 467 | NULL, |
| 468 | FFMIN(outlink->h, ctx->graph->nb_threads)); | 468 | FFMIN(outlink->h, ff_filter_get_nb_threads(ctx))); |
| 469 | } | 469 | } |
| 470 | 470 | ||
| 471 | if (lensfun->mode & (GEOMETRY_DISTORTION | SUBPIXEL_DISTORTION)) { | 471 | if (lensfun->mode & (GEOMETRY_DISTORTION | SUBPIXEL_DISTORTION)) { |
| @@ -493,7 +493,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 21 unmodified lines | |||
| 493 | distortion_correction_filter_slice, | 493 | distortion_correction_filter_slice, |
| 494 | &distortion_correction_thread_data, | 494 | &distortion_correction_thread_data, |
| 495 | NULL, | 495 | NULL, |
| 496 | FFMIN(outlink->h, ctx->graph->nb_threads)); | 496 | FFMIN(outlink->h, ff_filter_get_nb_threads(ctx))); |
| 497 | 497 | ||
| 498 | av_frame_free(&in); | 498 | av_frame_free(&in); |
| 499 | return ff_filter_frame(outlink, out); | 499 | return ff_filter_frame(outlink, out); |