Commit 07b3dbbb authored by Michael Niedermayer's avatar Michael Niedermayer

avutil/log: Move log_level_offset_offset code from av_log() to v_log()

Suggested-by: Anton
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 7b7f9753
......@@ -362,19 +362,19 @@ static void (*av_log_callback)(void*, int, const char*, va_list) =
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);
}
void av_vlog(void* avcl, int level, const char *fmt, va_list vl)
{
AVClass* avc = avcl ? *(AVClass **) avcl : NULL;
void (*log_callback)(void*, int, const char*, va_list) = av_log_callback;
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);
if (log_callback)
log_callback(avcl, level, 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