Skip to content
Snippets Groups Projects
Commit 4880cfd9 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

Print parent log context too, if available.

Originally committed as revision 23200 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 2c1bb265
No related branches found
No related tags found
No related merge requests found
...@@ -68,11 +68,17 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) ...@@ -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; AVClass* avc= ptr ? *(AVClass**)ptr : NULL;
if(level>av_log_level) if(level>av_log_level)
return; return;
line[0]=0;
#undef fprintf #undef fprintf
if(print_prefix && avc) { if(print_prefix && avc) {
snprintf(line, sizeof(line), "[%s @ %p]", avc->item_name(ptr), ptr); if(avc->version >= (50<<16 | 15<<8 | 3) && avc->parent_log_context_offset){
}else AVClass** parent= *(AVClass***)(((uint8_t*)ptr) + avc->parent_log_context_offset);
line[0]=0; 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); vsnprintf(line + strlen(line), sizeof(line) - strlen(line), fmt, vl);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment