From bb1b0a9f42dabbaa196266fc11fddede74845877 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 23 Mar 2014 21:46:29 +0100 Subject: player: remove confusing argc/argv adjustment It's better if argc/argv always mean the same thing. --- options/parse_commandline.c | 4 ++-- player/main.c | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/options/parse_commandline.c b/options/parse_commandline.c index 8db144241e..17b3f9254a 100644 --- a/options/parse_commandline.c +++ b/options/parse_commandline.c @@ -128,7 +128,7 @@ int m_config_parse_mp_command_line(m_config_t *config, struct playlist *files, mode = GLOBAL; - struct parse_state p = {config, argc, argv}; + struct parse_state p = {config, argc - 1, argv + 1}; while (split_opt(&p)) { if (p.is_opt) { int flags = M_SETOPT_FROM_CMDLINE; @@ -274,7 +274,7 @@ void m_config_preparse_command_line(m_config_t *config, struct mpv_global *globa // Hack to shut up parser error messages mp_msg_mute(global, true); - struct parse_state p = {config, argc, argv}; + struct parse_state p = {config, argc - 1, argv + 1}; while (split_opt_silent(&p) == 0) { if (p.is_opt) { // Ignore non-pre-parse options. They will be set later. diff --git a/player/main.c b/player/main.c index de88d0b817..d8edf2e304 100644 --- a/player/main.c +++ b/player/main.c @@ -460,11 +460,6 @@ int mpv_main(int argc, char *argv[]) { osdep_preinit(&argc, &argv); - if (argc >= 1) { - argc--; - argv++; - } - struct MPContext *mpctx = mp_create(); struct MPOpts *opts = mpctx->opts; -- cgit v1.2.3