[libav-devel] [PATCH] pthread: warn on high thread counts
Sean McGovern
gseanmcg at gmail.com
Mon Mar 19 06:08:14 CET 2012
---
libavcodec/pthread.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 2e4c6a8..4000d6b 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -1011,6 +1011,10 @@ 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)
--
1.7.7
More information about the libav-devel
mailing list