diff options
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r-- | libmpcodecs/vd_ffmpeg.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 64154aaff7..32e3bb9873 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -175,6 +175,15 @@ void mp_msp_av_log_callback(void* ptr, int level, const char* fmt, va_list vl) int mp_level; char buf[256]; + switch(level){ + case AV_LOG_DEBUG: mp_level= MSGL_V ; break; + case AV_LOG_INFO : mp_level= MSGL_INFO; break; + case AV_LOG_ERROR: mp_level= MSGL_ERR ; break; + default : mp_level= MSGL_ERR ; break; + } + + if (!mp_msg_test(type, mp_level)) return; + if(ptr){ if(!strcmp(avc->class_name, "AVCodecContext")){ AVCodecContext * s= ptr; @@ -199,13 +208,6 @@ void mp_msp_av_log_callback(void* ptr, int level, const char* fmt, va_list vl) } } - switch(level){ - case AV_LOG_DEBUG: mp_level= MSGL_V ; break; - case AV_LOG_INFO : mp_level= MSGL_INFO; break; - case AV_LOG_ERROR: mp_level= MSGL_ERR ; break; - default : mp_level= MSGL_ERR ; break; - } - if(print_prefix && avc) { mp_msg(type, mp_level, "[%s @ %p]", avc->item_name(ptr), avc); } |