summaryrefslogtreecommitdiffstats
path: root/mpvcore/m_config.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-25 22:52:54 +0200
committerwm4 <wm4@nowhere>2013-10-25 22:52:54 +0200
commitecc0705f83aea409fcd14fbbab10af7b0675d275 (patch)
treee2fbeb9d09622da889b95896086075e1c73b14a8 /mpvcore/m_config.h
parentd8896f0dba78d05f7ceb50ae9ca5097f384945bd (diff)
downloadmpv-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/m_config.h')
-rw-r--r--mpvcore/m_config.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/mpvcore/m_config.h b/mpvcore/m_config.h
index 0cff62d7ed..9dd479932d 100644
--- a/mpvcore/m_config.h
+++ b/mpvcore/m_config.h
@@ -36,14 +36,12 @@ struct m_obj_desc;
// Config option
struct m_config_option {
- bool is_generated : 1;
- // Full name (ie option-subopt).
- const char *name;
- // Option description.
- const struct m_option *opt;
- // Raw value of the option.
- void *data;
- const void *default_data;
+ bool is_generated : 1; // Automatically added ("no-" options)
+ bool is_set_from_cmdline : 1; // Set by user from command line
+ const char *name; // Full name (ie option-subopt)
+ const struct m_option *opt; // Option description
+ void *data; // Raw value of the option
+ const void *default_data; // Raw default value
};
// Config object
@@ -108,7 +106,9 @@ enum {
M_SETOPT_PRE_PARSE_ONLY = 1, // Silently ignore non-M_OPT_PRE_PARSE opt.
M_SETOPT_CHECK_ONLY = 2, // Don't set, just check name/value
M_SETOPT_FROM_CONFIG_FILE = 4, // Reject M_OPT_NOCFG opt. (print error)
- M_SETOPT_BACKUP = 8, // Call m_config_backup_opt() before
+ M_SETOPT_FROM_CMDLINE = 8, // Mark as set by command line
+ M_SETOPT_BACKUP = 16, // Call m_config_backup_opt() before
+ M_SETOPT_PRESERVE_CMDLINE = 32, // Don't set if already marked as FROM_CMDLINE
};
// Set the named option to the given string.