{"action":"opened","issue":{"url":"https://api.github.com/repos/bytedeco/javacpp-presets/issues/108","labels_url":"https://api.github.com/repos/bytedeco/javacpp-presets/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/bytedeco/javacpp-presets/issues/108/comments","events_url":"https://api.github.com/repos/bytedeco/javacpp-presets/issues/108/events","html_url":"https://github.com/bytedeco/javacpp-presets/issues/108","id":114429983,"number":108,"title":"LogCallback implementation","user":{"login":"8man","id":2679484,"avatar_url":"https://avatars.githubusercontent.com/u/2679484?v=3","gravatar_id":"","url":"https://api.github.com/users/8man","html_url":"https://github.com/8man","followers_url":"https://api.github.com/users/8man/followers","following_url":"https://api.github.com/users/8man/following{/other_user}","gists_url":"https://api.github.com/users/8man/gists{/gist_id}","starred_url":"https://api.github.com/users/8man/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/8man/subscriptions","organizations_url":"https://api.github.com/users/8man/orgs","repos_url":"https://api.github.com/users/8man/repos","events_url":"https://api.github.com/users/8man/events{/privacy}","received_events_url":"https://api.github.com/users/8man/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-31T19:41:27Z","updated_at":"2015-10-31T19:41:27Z","closed_at":null,"body":"I see that the new LogCallback class is an alternative to the [Callback_Pointer_int_String_Pointer](https://github.com/bytedeco/javacpp-presets/blob/master/ffmpeg/src/main/java/org/bytedeco/javacpp/avutil.java#L1639) and [Callback_Pointer_int_BytePointer_Pointer](https://github.com/bytedeco/javacpp-presets/blob/master/ffmpeg/src/main/java/org/bytedeco/javacpp/avutil.java#L1630) 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.\r\n\r\nThere 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.\r\n\r\nBut, more importantly, the callback is not thread-safe which it has to be according to [the documentation](https://www.ffmpeg.org/doxygen/2.7/group__lavu__log.html#ga6cdf5cd331b17e80e8308124f05a6db8):\r\n> The callback must be thread safe, even if the application does not use threads itself as some codecs are multithreaded.\r\n\r\n"}}