-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LogCallback implementation not thread-safe #108
Comments
It's not just an alternative: There's no standard way to dereference a If you'd like to implement something for
|
Is it that |
Actually the use of The real issue here is that people should either be aware that their custom callback must be thread-safe or forwarding the log messages should be done in a thread-safe manner. The problem with implementing In that case, we might as well lock the call to custom callback and guarantee thread-safety in |
Yeah, that'd be great! 👍 Thanks Looking inside |
Hi, have you made any progress since? |
I see that the new LogCallback class is an alternative to the Callback_Pointer_int_String_Pointer and Callback_Pointer_int_BytePointer_Pointer callbacks. Most people don't want to reinvent the wheel and simply want to redirect the log messages to wherever, so this is a welcome addition indeed.
There are two issues with its current implementation, though. First of all, the
AV_LOG_SKIP_REPEATED
flag isn't handled. People using this new callback will suddenly find that setting this flag will do nothing to avoid redundant log messages. It's an unfortunate flaw in FFmpeg's API that any custom callback has to handle this itself.But, more importantly, the callback is not thread-safe which it has to be according to the documentation:
The text was updated successfully, but these errors were encountered: