mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-27 05:10:20 +00:00
av_log: set default av_log callback on exit
This is slightly "dangerous", because it could overwrite a log callback another library has set, after we've set our own callback. But it's probably still slightly better than leaving our own callback, which will run the fallback code if no mpv instance is set. (Multiple mpv instances sharing the same global state will safely avoid overwriting each other's log callback.) Note that we can't do much better, because the global state in FFmpeg is obviously insane.
This commit is contained in:
@@ -173,6 +173,7 @@ void uninit_libav(struct mpv_global *global)
|
||||
{
|
||||
pthread_mutex_lock(&log_lock);
|
||||
if (log_mpv_instance == global) {
|
||||
av_log_set_callback(av_log_default_callback);
|
||||
log_mpv_instance = NULL;
|
||||
talloc_free(log_root);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user