summaryrefslogtreecommitdiffstats
path: root/options/parse_commandline.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-21 23:11:12 +0100
committerwm4 <wm4@nowhere>2013-12-21 23:11:12 +0100
commit245e5b844177e9ad9a9c07eff5efab7c3fccdebc (patch)
treeb70f214f8c3fc802d6d6edbf8395273c854ac0fd /options/parse_commandline.c
parent678ce04b3f7b7af845f77981fd0056845afa37fe (diff)
downloadmpv-245e5b844177e9ad9a9c07eff5efab7c3fccdebc.tar.bz2
mpv-245e5b844177e9ad9a9c07eff5efab7c3fccdebc.tar.xz
msg: remove global state
Diffstat (limited to 'options/parse_commandline.c')
-rw-r--r--options/parse_commandline.c13
1 files changed, 9 insertions, 4 deletions
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 <assert.h>
#include <stdbool.h>
+#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);
}