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:
wm4 2015-06-17 14:52:31 +02:00
parent d4aaf29a05
commit f53135ffea
1 changed files with 1 additions and 0 deletions

View File

@ -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);
}