summaryrefslogtreecommitdiff
path: root/fftools/ffplay.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2019-02-02 20:30:16 +0100
committerMarton Balint <cus@passwd.hu>2019-02-07 23:38:53 +0100
commit7cab5471b231bcdb593bf4ec96a263f935df30b1 (patch)
tree7fb61271c4ed777e277c9e68467b08ecfbbc22bd /fftools/ffplay.c
parentfe99a51c40d5daaab08851508b900848e0f64d83 (diff)
downloadffmpeg-7cab5471b231bcdb593bf4ec96a263f935df30b1.tar.gz
ffplay: add support for setting the number of filter threads
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'fftools/ffplay.c')
-rw-r--r--fftools/ffplay.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index f84052a89b..8f050e16e6 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -353,6 +353,7 @@ static char *afilters = NULL;
#endif
static int autorotate = 1;
static int find_stream_info = 1;
+static int filter_nbthreads = 0;
/* current context */
static int is_full_screen;
@@ -1954,6 +1955,7 @@ static int configure_audio_filters(VideoState *is, const char *afilters, int for
avfilter_graph_free(&is->agraph);
if (!(is->agraph = avfilter_graph_alloc()))
return AVERROR(ENOMEM);
+ is->agraph->nb_threads = filter_nbthreads;
while ((e = av_dict_get(swr_opts, "", e, AV_DICT_IGNORE_SUFFIX)))
av_strlcatf(aresample_swr_opts, sizeof(aresample_swr_opts), "%s=%s:", e->key, e->value);
@@ -2162,6 +2164,7 @@ static int video_thread(void *arg)
ret = AVERROR(ENOMEM);
goto the_end;
}
+ graph->nb_threads = filter_nbthreads;
if ((ret = configure_video_filters(graph, is, vfilters_list ? vfilters_list[is->vfilter_idx] : NULL, frame)) < 0) {
SDL_Event event;
event.type = FF_QUIT_EVENT;
@@ -3611,6 +3614,7 @@ static const OptionDef options[] = {
{ "autorotate", OPT_BOOL, { &autorotate }, "automatically rotate video", "" },
{ "find_stream_info", OPT_BOOL | OPT_INPUT | OPT_EXPERT, { &find_stream_info },
"read and decode the streams to fill missing information with heuristics" },
+ { "filter_threads", HAS_ARG | OPT_INT | OPT_EXPERT, { &filter_nbthreads }, "number of filter threads per graph" },
{ NULL, },
};