[FFmpeg-devel] [PATCH v3] avfilter/src_movie: make the number of decode thread configurable

lance.lmwang at gmail.com lance.lmwang at gmail.com
Sat Nov 6 15:48:35 EET 2021


From: Limin Wang <lance.lmwang at gmail.com>

Please use threads option if you want the number of thread configurable.

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
 libavfilter/src_movie.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index 573f363..5811675 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -169,7 +169,9 @@ static int open_stream(AVFilterContext *ctx, MovieStream *st)
     if (ret < 0)
         return ret;
 
-    st->codec_ctx->thread_count = ff_filter_get_nb_threads(ctx);
+    if (!ctx->nb_threads)
+        ctx->nb_threads = ff_filter_get_nb_threads(ctx);
+    st->codec_ctx->thread_count = ctx->nb_threads;
 
     if ((ret = avcodec_open2(st->codec_ctx, codec, NULL)) < 0) {
         av_log(ctx, AV_LOG_ERROR, "Failed to open codec\n");
-- 
1.8.3.1



More information about the ffmpeg-devel mailing list