pthread: warn on high thread counts
authorSean McGovern <gseanmcg@gmail.com>
Mon, 19 Mar 2012 05:08:14 +0000 (01:08 -0400)
committerDiego Biurrun <diego@biurrun.de>
Mon, 7 May 2012 08:35:01 +0000 (10:35 +0200)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
libavcodec/pthread.c

index 1889d2a..88d8ade 100644 (file)
@@ -1015,6 +1015,11 @@ static void validate_thread_parameters(AVCodecContext *avctx)
         avctx->thread_count       = 1;
         avctx->active_thread_type = 0;
     }
+
+    if (avctx->thread_count > MAX_AUTO_THREADS)
+        av_log(avctx, AV_LOG_WARNING,
+               "Application has requested %d threads. Using a thread count greater than %d is not recommended.\n",
+               avctx->thread_count, MAX_AUTO_THREADS);
 }
 
 int ff_thread_init(AVCodecContext *avctx)