msg: fix printing of module header

The code to set root->header was moved before the point where it's used,
which broke the logic.
This commit is contained in:
wm4 2014-01-14 17:37:30 +01:00
parent 1cd1fb9e5c
commit da00282e3a
1 changed files with 2 additions and 1 deletions

View File

@ -196,6 +196,7 @@ void mp_msg_va(struct mp_log *log, int lev, const char *format, va_list va)
tmp[MSGSIZE_MAX - 2] = '\n'; tmp[MSGSIZE_MAX - 2] = '\n';
tmp[MSGSIZE_MAX - 1] = 0; tmp[MSGSIZE_MAX - 1] = 0;
bool header = root->header;
char *terminate = ""; char *terminate = "";
if (lev == MSGL_STATUS) { if (lev == MSGL_STATUS) {
@ -214,7 +215,7 @@ void mp_msg_va(struct mp_log *log, int lev, const char *format, va_list va)
if (root->color) if (root->color)
set_msg_color(stream, lev); set_msg_color(stream, lev);
if (root->header) { if (header) {
if ((lev >= MSGL_V && lev != MSGL_SMODE) || root->verbose || root->module) { if ((lev >= MSGL_V && lev != MSGL_SMODE) || root->verbose || root->module) {
fprintf(stream, "[%s] ", log->verbose_prefix); fprintf(stream, "[%s] ", log->verbose_prefix);
} else if (log->prefix) { } else if (log->prefix) {