diff options
author | wm4 <wm4@nowhere> | 2013-02-08 23:52:06 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-02-09 00:21:18 +0100 |
commit | a1be0e1aecdd88bbc56b940e00d3bf51b96c0e4c (patch) | |
tree | aa472dd8f39cafcd0b3e38030ee8a945f4b3103d /core/mplayer.c | |
parent | c1ddfb59076e9b568484b97f10b4eadeb48384e3 (diff) | |
download | mpv-a1be0e1aecdd88bbc56b940e00d3bf51b96c0e4c.tar.bz2 mpv-a1be0e1aecdd88bbc56b940e00d3bf51b96c0e4c.tar.xz |
options: change --no-config option, make it apply to input.conf as well
Simplify --no-config and make it a normal flag option, and doesn't take
an argument anymore. You can get the same behavior by using --no-config
and then --include to explicitly load a certain config file.
Make --no-config work for input.conf as well. Make it so that
--input:conf=file still works in this case. As a technically unrelated
change, the file argument now works as one would expect, instead of
making it relatively to "~/.mpv/". This makes for simpler code and
easier to understand option semantics. We can also print better error
messages.
Diffstat (limited to 'core/mplayer.c')
-rw-r--r-- | core/mplayer.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/mplayer.c b/core/mplayer.c index 65bd1f2f8e..5dc719d97f 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -689,8 +689,9 @@ static bool parse_cfgfiles(struct MPContext *mpctx, m_config_t *conf) struct MPOpts *opts = &mpctx->opts; char *conffile; int conffile_fd; - if (!(opts->noconfig & 2) && - m_config_parse_config_file(conf, MPLAYER_CONFDIR "/mpv.conf") < 0) + if (!opts->load_config) + return true; + if (!m_config_parse_config_file(conf, MPLAYER_CONFDIR "/mpv.conf") < 0) return false; if ((conffile = mp_find_user_config_file("")) == NULL) mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "Cannot find HOME directory.\n"); @@ -708,8 +709,7 @@ static bool parse_cfgfiles(struct MPContext *mpctx, m_config_t *conf) write(conffile_fd, DEF_CONFIG, sizeof(DEF_CONFIG) - 1); close(conffile_fd); } - if (!(opts->noconfig & 1) && - m_config_parse_config_file(conf, conffile) < 0) + if (m_config_parse_config_file(conf, conffile) < 0) return false; talloc_free(conffile); } @@ -3657,7 +3657,7 @@ static void check_previous_track_selection(struct MPContext *mpctx) static void init_input(struct MPContext *mpctx) { - mpctx->input = mp_input_init(&mpctx->opts.input); + mpctx->input = mp_input_init(&mpctx->opts.input, mpctx->opts.load_config); mpctx->key_fifo = mp_fifo_create(mpctx->input, &mpctx->opts); if (slave_mode) mp_input_add_cmd_fd(mpctx->input, 0, USE_FD0_CMD_SELECT, MP_INPUT_SLAVE_CMD_FUNC, NULL); |