Commit 57976bc8 authored by michael's avatar michael

Print parent log context too, if available.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@23200 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent be2bad16
......@@ -68,11 +68,17 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment