avcodec/utils: Warn the user about the lack of a lock manager if insufficient locks...
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 23 Jul 2013 23:04:24 +0000 (01:04 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 23 Jul 2013 23:11:09 +0000 (01:11 +0200)
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 <michaelni@gmx.at>
libavcodec/utils.c

index ea83fe8..20d487c 100644 (file)
@@ -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);