Revision 4880cfd9

View differences:

libavutil/log.c
68 68
    AVClass* avc= ptr ? *(AVClass**)ptr : NULL;
69 69
    if(level>av_log_level)
70 70
        return;
71
    line[0]=0;
71 72
#undef fprintf
72 73
    if(print_prefix && avc) {
73
        snprintf(line, sizeof(line), "[%s @ %p]", avc->item_name(ptr), ptr);
74
    }else
75
        line[0]=0;
74
        if(avc->version >= (50<<16 | 15<<8 | 3) && avc->parent_log_context_offset){
75
            AVClass** parent= *(AVClass***)(((uint8_t*)ptr) + avc->parent_log_context_offset);
76
            if(parent && *parent){
77
                snprintf(line, sizeof(line), "[%s @ %p]", (*parent)->item_name(parent), parent);
78
            }
79
        }
80
        snprintf(line + strlen(line), sizeof(line) - strlen(line), "[%s @ %p]", avc->item_name(ptr), ptr);
81
    }
76 82

  
77 83
    vsnprintf(line + strlen(line), sizeof(line) - strlen(line), fmt, vl);
78 84

  

Also available in: Unified diff