mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
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@gmx.at>
This commit is contained in:
parent
55db06af64
commit
274a50ab57
@ -3073,6 +3073,8 @@ int ff_lock_avcodec(AVCodecContext *log_ctx)
|
|||||||
entangled_thread_counter++;
|
entangled_thread_counter++;
|
||||||
if (entangled_thread_counter != 1) {
|
if (entangled_thread_counter != 1) {
|
||||||
av_log(log_ctx, AV_LOG_ERROR, "Insufficient thread locking around avcodec_open/close()\n");
|
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_avcodec_locked = 1;
|
||||||
ff_unlock_avcodec();
|
ff_unlock_avcodec();
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
|
Loading…
Reference in New Issue
Block a user