Mercurial > libavutil.hg
diff log.c @ 924:d45ace227adf libavutil
Print parent log context too, if available.
author | michael |
---|---|
date | Wed, 19 May 2010 22:51:38 +0000 |
parents | 2acb0b1891c0 |
children | 252d7a7ee7d5 |
line wrap: on
line diff
--- a/log.c Wed May 19 22:50:39 2010 +0000 +++ b/log.c Wed May 19 22:51:38 2010 +0000 @@ -68,11 +68,17 @@ AVClass* avc= ptr ? *(AVClass**)ptr : NULL; if(level>av_log_level) return; + line[0]=0; #undef fprintf if(print_prefix && avc) { - snprintf(line, sizeof(line), "[%s @ %p]", avc->item_name(ptr), ptr); - }else - line[0]=0; + if(avc->version >= (50<<16 | 15<<8 | 3) && avc->parent_log_context_offset){ + AVClass** parent= *(AVClass***)(((uint8_t*)ptr) + avc->parent_log_context_offset); + if(parent && *parent){ + snprintf(line, sizeof(line), "[%s @ %p]", (*parent)->item_name(parent), parent); + } + } + snprintf(line + strlen(line), sizeof(line) - strlen(line), "[%s @ %p]", avc->item_name(ptr), ptr); + } vsnprintf(line + strlen(line), sizeof(line) - strlen(line), fmt, vl);