diff mbox series

[FFmpeg-devel,v2] avfilter/src_movie: Add a maximum constraint of 16 slice threads

Message ID 1636180390-27048-1-git-send-email-lance.lmwang@gmail.com
State New
Headers show
Series [FFmpeg-devel,v2] avfilter/src_movie: Add a maximum constraint of 16 slice threads | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Limin Wang Nov. 6, 2021, 6:33 a.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

It's configured the number of video decode thread, so use the same maximum constraint
as MAX_AUTO_THREADS in libavcodec/pthread_internal.h

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavfilter/src_movie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul B Mahol Nov. 6, 2021, 10:44 a.m. UTC | #1
NACK
Limin Wang Nov. 6, 2021, 12:56 p.m. UTC | #2
On Sat, Nov 06, 2021 at 11:44:08AM +0100, Paul B Mahol wrote:
> NACK

What's your suggestion? any objection if add a thread option for src_movie
filter?
diff mbox series

Patch

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