mp_msg_levels[] will go away.
Unified · Split
| @@ -59,6 +59,7 @@ static struct mp_log *legacy_logs[MSGT_MAX]; · 58 unmodified lines | ||
| 59 | 59 | int mp_msg_levels[MSGT_MAX]; // verbose level of this module. initialized to -2 |
| 60 | 60 | int mp_msg_level_all = MSGL_STATUS; |
| 61 | 61 | int verbose = 0; |
| 62 | +bool mp_msg_mute; | |
| 62 | 63 | int mp_msg_color = 1; |
| 63 | 64 | int mp_msg_module = 0; |
| 64 | 65 | int mp_msg_cancolor = 0; |
| @@ -79,6 +80,8 @@ static void mp_msg_do_init(void){ · 14 unmodified lines | ||
| 79 | 80 | |
| 80 | 81 | int mp_msg_test(int mod, int lev) |
| 81 | 82 | { |
| 83 | + if (mp_msg_mute) | |
| 84 | + return false; | |
| 82 | 85 | if (lev == MSGL_STATUS) { |
| 83 | 86 | // skip status line output if stderr is a tty but in background |
| 84 | 87 | if (terminal_in_background()) |
| @@ -28,8 +28,8 @@ · 27 unmodified lines | ||
| 28 | 28 | |
| 29 | 29 | struct mp_log; |
| 30 | 30 | |
| 31 | −// defined in mplayer.c | |
| 32 | 31 | extern int verbose; |
| 32 | +extern bool mp_msg_mute; | |
| 33 | 33 | |
| 34 | 34 | // verbosity elevel: |
| 35 | 35 | |
| @@ -265,8 +265,6 @@ err_out: · 264 unmodified lines | ||
| 265 | 265 | return ret; |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | −extern int mp_msg_levels[]; | |
| 269 | − | |
| 270 | 268 | /* Parse some command line options early before main parsing. |
| 271 | 269 | * --no-config prevents reading configuration files (otherwise done before |
| 272 | 270 | * command line parsing), and --really-quiet suppresses messages printed |
| @@ -275,8 +273,7 @@ extern int mp_msg_levels[]; · 2 unmodified lines | ||
| 275 | 273 | void m_config_preparse_command_line(m_config_t *config, int argc, char **argv) |
| 276 | 274 | { |
| 277 | 275 | // Hack to shut up parser error messages |
| 278 | − int msg_lvl_backup = mp_msg_levels[MSGT_CFGPARSER]; | |
| 279 | − mp_msg_levels[MSGT_CFGPARSER] = -11; | |
| 276 | + mp_msg_mute = true; | |
| 280 | 277 | |
| 281 | 278 | struct parse_state p = {config, argc, argv}; |
| 282 | 279 | while (split_opt_silent(&p) == 0) { |
| @@ -290,5 +287,5 @@ void m_config_preparse_command_line(m_config_t *config, int argc, char **argv) · 7 unmodified lines | ||
| 290 | 287 | } |
| 291 | 288 | } |
| 292 | 289 | |
| 293 | − mp_msg_levels[MSGT_CFGPARSER] = msg_lvl_backup; | |
| 290 | + mp_msg_mute = false; | |
| 294 | 291 | } |