diff options
author | wm4 <wm4@nowhere> | 2013-10-25 22:52:54 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-10-25 22:52:54 +0200 |
commit | ecc0705f83aea409fcd14fbbab10af7b0675d275 (patch) | |
tree | e2fbeb9d09622da889b95896086075e1c73b14a8 /mpvcore/parser-mpcmd.c | |
parent | d8896f0dba78d05f7ceb50ae9ca5097f384945bd (diff) | |
download | mpv-ecc0705f83aea409fcd14fbbab10af7b0675d275.tar.bz2 mpv-ecc0705f83aea409fcd14fbbab10af7b0675d275.tar.xz |
options: don't let watch_later etc. overwite command line options
There are certain cases where mpv will automatically set options, such
as per-file configs, per protocol/VO/AO/extension profiles, and
watch_later resume configs. All these were overwriting the user's
options, even when they were specified on command line.
Add something that explicitly preserves command line options. This
means you can now actually use the command line to override any
options that the playback resume functionality backups and restores.
It still happily overrides options set at runtime (e.g. changed via
properties while playing a file; then playing the next file might
override them again), but maybe that's not a problem with typical use.
Diffstat (limited to 'mpvcore/parser-mpcmd.c')
-rw-r--r-- | mpvcore/parser-mpcmd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mpvcore/parser-mpcmd.c b/mpvcore/parser-mpcmd.c index e85085b808..6890e94fe0 100644 --- a/mpvcore/parser-mpcmd.c +++ b/mpvcore/parser-mpcmd.c @@ -129,9 +129,10 @@ int m_config_parse_mp_command_line(m_config_t *config, struct playlist *files, struct parse_state p = {config, argc, argv}; while (split_opt(&p)) { if (p.is_opt) { - int flags = mode == LOCAL ? M_SETOPT_BACKUP | M_SETOPT_CHECK_ONLY : 0; - int r; - r = m_config_set_option_ext(config, p.arg, p.param, flags); + int flags = M_SETOPT_FROM_CMDLINE; + if (mode == LOCAL) + flags |= M_SETOPT_BACKUP | M_SETOPT_CHECK_ONLY; + int r = m_config_set_option_ext(config, p.arg, p.param, flags); if (r <= M_OPT_EXIT) { ret = r; goto err_out; @@ -282,8 +283,8 @@ void m_config_preparse_command_line(m_config_t *config, int argc, char **argv) if (p.is_opt) { // Ignore non-pre-parse options. They will be set later. // Option parsing errors will be handled later as well. - m_config_set_option_ext(config, p.arg, p.param, - M_SETOPT_PRE_PARSE_ONLY); + 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++; } |