From 274a50ab57381c67946923acdf7ed6e2c7008790 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 24 Jul 2013 01:04:24 +0200 Subject: [PATCH] avcodec/utils: Warn the user about the lack of a lock manager if insufficient locks are detected A lock manager is not the only possibility to avoid open/close locking issues but its easier and more robust than maintaining a lot of lock/unlock calls. Signed-off-by: Michael Niedermayer --- libavcodec/utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index ea83fe8a1e..20d487c52e 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -3073,6 +3073,8 @@ int ff_lock_avcodec(AVCodecContext *log_ctx) entangled_thread_counter++; if (entangled_thread_counter != 1) { av_log(log_ctx, AV_LOG_ERROR, "Insufficient thread locking around avcodec_open/close()\n"); + if (!lockmgr_cb) + av_log(log_ctx, AV_LOG_ERROR, "No lock manager is set, please see av_lockmgr_register()\n"); ff_avcodec_locked = 1; ff_unlock_avcodec(); return AVERROR(EINVAL);