aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_filter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-08-08 11:42:20 +0200
committerAnton Khirnov <anton@khirnov.net>2021-08-29 18:44:09 +0200
commit834b8ad8a39b77105951f30dc73c6a203afca817 (patch)
tree7b10d2f3b1d8095b899a5fcc934f2c8249124511 /fftools/ffmpeg_filter.c
parent4a0d918c9ef08ac4e0118d537ba561f90dfb960f (diff)
downloadffmpeg-834b8ad8a39b77105951f30dc73c6a203afca817.tar.gz
ffmpeg_filter: do not override -filter_threads with -threads
When both -filter_threads and -threads are specified, the latter takes effect. Since -threads is an encoder option and -filter_threads is a filter option, it makes sense for the -filter_threads to take precedence.
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r--fftools/ffmpeg_filter.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 64d2772f5d..67ae2dc824 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -969,6 +969,11 @@ int configure_filtergraph(FilterGraph *fg)
AVDictionaryEntry *e = NULL;
fg->graph->nb_threads = filter_nbthreads;
+ if (!fg->graph->nb_threads) {
+ e = av_dict_get(ost->encoder_opts, "threads", NULL, 0);
+ if (e)
+ av_opt_set(fg->graph, "threads", e->value, 0);
+ }
args[0] = 0;
e = NULL;
@@ -1003,10 +1008,6 @@ int configure_filtergraph(FilterGraph *fg)
}
if (strlen(args))
args[strlen(args) - 1] = '\0';
-
- e = av_dict_get(ost->encoder_opts, "threads", NULL, 0);
- if (e)
- av_opt_set(fg->graph, "threads", e->value, 0);
} else {
fg->graph->nb_threads = filter_complex_nbthreads;
}