From 245e5b844177e9ad9a9c07eff5efab7c3fccdebc Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 21 Dec 2013 23:11:12 +0100 Subject: msg: remove global state --- options/parse_commandline.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'options/parse_commandline.c') diff --git a/options/parse_commandline.c b/options/parse_commandline.c index 7c4eb3cce7..11ef85a871 100644 --- a/options/parse_commandline.c +++ b/options/parse_commandline.c @@ -25,9 +25,11 @@ #include #include +#include "common/global.h" #include "common/msg.h" #include "m_option.h" #include "m_config.h" +#include "options.h" #include "common/playlist.h" #include "common/playlist_parser.h" #include "parse_commandline.h" @@ -263,10 +265,13 @@ err_out: * command line parsing), and --really-quiet suppresses messages printed * during normal options parsing. */ -void m_config_preparse_command_line(m_config_t *config, int argc, char **argv) +void m_config_preparse_command_line(m_config_t *config, struct mpv_global *global, + int argc, char **argv) { + struct MPOpts *opts = global->opts; + // Hack to shut up parser error messages - mp_msg_mute = true; + mp_msg_mute(global, true); struct parse_state p = {config, argc, argv}; while (split_opt_silent(&p) == 0) { @@ -276,9 +281,9 @@ void m_config_preparse_command_line(m_config_t *config, int argc, char **argv) int flags = M_SETOPT_FROM_CMDLINE | M_SETOPT_PRE_PARSE_ONLY; m_config_set_option_ext(config, p.arg, p.param, flags); if (bstrcmp0(p.arg, "v") == 0) - verbose++; + opts->verbose++; } } - mp_msg_mute = false; + mp_msg_mute(global, false); } -- cgit v1.2.3