diff options
author | Paul B Mahol <onemda@gmail.com> | 2016-08-27 22:22:58 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2016-08-29 16:27:09 +0200 |
commit | 5b1907142dca052c3254d0b4ca3e2ff7ddc7d96b (patch) | |
tree | b228875fee9680f01b95fe85fda147e207646edb /libavfilter/avfilter.c | |
parent | 449339084fb2fe9259d8612a9c8c2a886022d1f5 (diff) | |
download | ffmpeg-5b1907142dca052c3254d0b4ca3e2ff7ddc7d96b.tar.gz |
avfilter: add ff_filter_get_nb_threads()
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r-- | libavfilter/avfilter.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index a8e5a5a73d..b2365354a2 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -783,6 +783,13 @@ void avfilter_free(AVFilterContext *filter) av_free(filter); } +int ff_filter_get_nb_threads(AVFilterContext *ctx) +{ + if (ctx->nb_threads > 0) + return FFMIN(ctx->nb_threads, ctx->graph->nb_threads); + return ctx->graph->nb_threads; +} + static int process_options(AVFilterContext *ctx, AVDictionary **options, const char *args) { |