[FFmpeg-devel] [PATCH 2/2] avutil/slicethread: Add a maximum constraint of 16 slice threads
lance.lmwang at gmail.com
lance.lmwang at gmail.com
Fri Nov 5 14:32:16 EET 2021
From: Limin Wang <lance.lmwang at gmail.com>
Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
libavutil/slicethread.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavutil/slicethread.c b/libavutil/slicethread.c
index 867ce32..7b3a106 100644
--- a/libavutil/slicethread.c
+++ b/libavutil/slicethread.c
@@ -104,7 +104,7 @@ int avpriv_slicethread_create(AVSliceThread **pctx, void *priv,
if (!nb_threads) {
int nb_cpus = av_cpu_count();
if (nb_cpus > 1)
- nb_threads = nb_cpus + 1;
+ nb_threads = FFMIN(nb_cpus + 1, 16);
else
nb_threads = 1;
}
--
1.8.3.1
More information about the ffmpeg-devel
mailing list