mirror of https://github.com/mpv-player/mpv
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.)
This commit is contained in:
parent
48970cd485
commit
633152e55a
|
@ -36,6 +36,7 @@ Interface changes
|
|||
- renamed the TRCs `st2084` and `std-b67` to `pq` and `hlg` respectively
|
||||
- the "osd" command is deprecated (use "cycle osd-level")
|
||||
- --field-dominance is deprecated (no replacement)
|
||||
- --really-quiet subtle behavior change
|
||||
--- mpv 0.25.0 ---
|
||||
- remove opengl-cb dxva2 dummy hwdec interop
|
||||
(see git "vo_opengl: remove dxva2 dummy hwdec backend")
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -261,8 +261,7 @@ const m_option_t mp_opts[] = {
|
|||
|
||||
// ------------------------- common options --------------------
|
||||
OPT_FLAG("quiet", quiet, 0),
|
||||
OPT_FLAG_STORE("really-quiet", verbose,
|
||||
M_OPT_FIXED | CONF_PRE_PARSE | M_OPT_NOPROP, -10),
|
||||
OPT_FLAG("really-quiet", msg_really_quiet, CONF_PRE_PARSE | UPDATE_TERM),
|
||||
OPT_FLAG("terminal", use_terminal, CONF_PRE_PARSE | UPDATE_TERM),
|
||||
OPT_GENERAL(char**, "msg-level", msg_levels, CONF_PRE_PARSE | UPDATE_TERM,
|
||||
.type = &m_option_type_msglevels),
|
||||
|
|
|
@ -73,6 +73,7 @@ typedef struct MPOpts {
|
|||
int use_terminal;
|
||||
char *dump_stats;
|
||||
int verbose;
|
||||
int msg_really_quiet;
|
||||
char **msg_levels;
|
||||
int msg_color;
|
||||
int msg_module;
|
||||
|
|
Loading…
Reference in New Issue