# HG changeset patch # User henry # Date 1164542920 0 # Node ID 8d671a2c1b00fe5fe5551803e64575966e55bdaa # Parent 6e3fb3e851ac4ac210d171cefc423967fcc69fac Check the log level before processing the message diff -r 6e3fb3e851ac -r 8d671a2c1b00 libmpcodecs/vd_ffmpeg.c --- a/libmpcodecs/vd_ffmpeg.c Sun Nov 26 12:03:23 2006 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Sun Nov 26 12:08:40 2006 +0000 @@ -175,6 +175,15 @@ 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 @@ } } - 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); }