From 633152e55a6f851c58267793081dea3162acfb48 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 23 Jun 2017 20:42:20 +0200 Subject: options: remove weird --really-quiet special behavior This was especially grating because it causes problems with the option/property unification, uses as only thing OPT_FLAG_STORE, and behaves weird with the client API or scripts. It can be reimplemented in a much simpler way, although it needs slightly more code. (Simpler because less special cases.) --- common/msg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/msg.c b/common/msg.c index cf2bd5c242..6e981406ff 100644 --- a/common/msg.c +++ b/common/msg.c @@ -57,6 +57,7 @@ struct mp_log_root { int status_lines; // number of current status lines bool color; int verbose; + bool really_quiet; bool force_stderr; struct mp_log_buffer **buffers; int num_buffers; @@ -110,7 +111,9 @@ static void update_loglevel(struct mp_log *log) { struct mp_log_root *root = log->root; pthread_mutex_lock(&mp_msg_lock); - log->level = MSGL_STATUS + log->root->verbose; // default log level + log->level = MSGL_STATUS; // default log level + if (root->really_quiet) + log->level -= 10; 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]); @@ -511,6 +514,7 @@ void mp_msg_update_msglevels(struct mpv_global *global) pthread_mutex_lock(&mp_msg_lock); root->verbose = opts->verbose; + root->really_quiet = opts->msg_really_quiet; root->module = opts->msg_module; root->use_terminal = opts->use_terminal; root->show_time = opts->msg_time; -- cgit v1.2.3