From 3fe1ec39c6eeba3348e3824df0d185525c321d57 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 8 May 2010 20:41:20 +0000 Subject: Add means to adjust the log level per context. Originally committed as revision 23059 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavutil/log.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavutil/log.c') diff --git a/libavutil/log.c b/libavutil/log.c index 9a8b66ee4d..547287fc29 100644 --- a/libavutil/log.c +++ b/libavutil/log.c @@ -89,8 +89,11 @@ static void (*av_log_callback)(void*, int, const char*, va_list) = av_log_defaul void av_log(void* avcl, int level, const char *fmt, ...) { + AVClass* avc= avcl ? *(AVClass**)avcl : NULL; va_list vl; va_start(vl, fmt); + if(avc && avc->version >= (50<<16 | 15<<8 | 2) && avc->log_level_offset_offset && level>=AV_LOG_FATAL) + level += *(int*)(((uint8_t*)avcl) + avc->log_level_offset_offset); av_vlog(avcl, level, fmt, vl); va_end(vl); } -- cgit v1.2.3