mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Merge pull request #25419 from vrabaud:ffmpeg
Fix race condition in InternalFFMpegRegister initialization. #25419 initLogger_ does not check if the logger has been initizalized before and it might initialize it several times from different threads, racing with other threads that are logging. ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work
This commit is contained in:
parent
05a54b1405
commit
c317a3ee89
@ -927,7 +927,6 @@ public:
|
||||
if(!threadSafe)
|
||||
lock.lock();
|
||||
static InternalFFMpegRegister instance;
|
||||
initLogger_(); // update logger setup unconditionally (GStreamer's libav plugin may override these settings)
|
||||
}
|
||||
static void initLogger_()
|
||||
{
|
||||
@ -965,6 +964,7 @@ public:
|
||||
/* register a callback function for synchronization */
|
||||
av_lockmgr_register(&LockCallBack);
|
||||
#endif
|
||||
initLogger_();
|
||||
}
|
||||
~InternalFFMpegRegister()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user