summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2021-02-21 14:11:22 +0100
committerJan Ekström <jeebjp@gmail.com>2021-02-23 00:56:21 +0200
commit26ec0e3d46a75b48d10b0dd99162e456d8a9dba8 (patch)
tree323bdc63e16eac17390092551fe7dd7c5a22c338 /common
parent56669fb44e71198e91159bcc68417efc72314379 (diff)
downloadmpv-26ec0e3d46a75b48d10b0dd99162e456d8a9dba8.tar.bz2
mpv-26ec0e3d46a75b48d10b0dd99162e456d8a9dba8.tar.xz
msg: fix really-quiet option to only affect terminal output
if log-file and really-quiet options were used together it could lead to a completely empty log-file. this is unexpected because we need the log-file option to work in all cases and produces at least a log of verbosity -v -v. this is a regression of commit a600d152d21ef398eb72b008ee3fe266696eb638 move the really quiet check back up, so it's set before the evaluation of the actual log level, where check for log file, terminal, etc take place.
Diffstat (limited to 'common')
-rw-r--r--common/msg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/msg.c b/common/msg.c
index 7e271d1b8b..81c7f654f3 100644
--- a/common/msg.c
+++ b/common/msg.c
@@ -126,6 +126,8 @@ static void update_loglevel(struct mp_log *log)
struct mp_log_root *root = log->root;
pthread_mutex_lock(&root->lock);
log->level = MSGL_STATUS + root->verbose; // default log level
+ if (root->really_quiet)
+ log->level = -1;
for (int n = 0; root->msg_levels && root->msg_levels[n * 2 + 0]; n++) {
if (match_mod(log->verbose_prefix, root->msg_levels[n * 2 + 0]))
log->level = mp_msg_find_level(root->msg_levels[n * 2 + 1]);
@@ -143,8 +145,6 @@ static void update_loglevel(struct mp_log *log)
if (log->root->stats_file)
log->level = MPMAX(log->level, MSGL_STATS);
log->level = MPMIN(log->level, log->max_level);
- if (root->really_quiet)
- log->level = -1;
atomic_store(&log->reload_counter, atomic_load(&log->root->reload_counter));
pthread_mutex_unlock(&root->lock);
}