[FFmpeg-cvslog] avcodec/utils: Warn the user about the lack of a lock manager if insufficient locks are detected

Michael Niedermayer git at videolan.org
Wed Jul 24 01:14:45 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jul 24 01:04:24 2013 +0200| [274a50ab57381c67946923acdf7ed6e2c7008790] | committer: Michael Niedermayer

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 <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=274a50ab57381c67946923acdf7ed6e2c7008790
---

 libavcodec/utils.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index ea83fe8..20d487c 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);



More information about the ffmpeg-cvslog mailing list