diff options
author | wm4 <wm4@nowhere> | 2019-11-10 23:49:23 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-11-10 23:49:23 +0100 |
commit | 4cae19237758a21685c9d988d24dafac713f3a30 (patch) | |
tree | 066c6a4fa77239a2a43b546d7b2182d0b7432c70 /options/m_config.h | |
parent | 20c9538e3236779fabe21c6fbdb7e6e039bd32b1 (diff) | |
download | mpv-4cae19237758a21685c9d988d24dafac713f3a30.tar.bz2 mpv-4cae19237758a21685c9d988d24dafac713f3a30.tar.xz |
options: remove M_OPT_FIXED
Options marked with this flag were changed to strictly read-only after
initialization (mpv_initialize() in the client API, after option parsing
and config file loading with the CLI player).
This used to be necessary, because there was a single option struct that
could be accessed by multiple threads. For example, --config-dir sets
MPOpts.force_configdir, which was read whenever anything accessed the
mpv config dir (which could be on different threads, e.g. font
initialization tries to lookup fonts.conf from an arbitrary thread).
This isn't needed anymore, because threads now access these in a thread
safe way. In the case of --config-dir, the path is actually just copied
on init.
This M_OPT_FIXED mechanism is thus not strictly needed anymore. It still
prevents writing to some options that cannot take effect at runtime, but
even that can be dropped. In general, all mpv options can be changed any
time at runtime, even if they never take effect, and there's no need to
make an exception for a very low number of options. So just get rid of
it.
Diffstat (limited to 'options/m_config.h')
-rw-r--r-- | options/m_config.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/options/m_config.h b/options/m_config.h index c843aa01f0..3456aab526 100644 --- a/options/m_config.h +++ b/options/m_config.h @@ -150,13 +150,12 @@ enum { 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 - M_SETOPT_NO_FIXED = 64, // Reject M_OPT_FIXED options M_SETOPT_NO_PRE_PARSE = 128, // Reject M_OPT_PREPARSE options M_SETOPT_NO_OVERWRITE = 256, // Skip options marked with FROM_* }; // Flags for safe option setting during runtime. -#define M_SETOPT_RUNTIME M_SETOPT_NO_FIXED +#define M_SETOPT_RUNTIME 0 // Set the named option to the given string. This is for command line and config // file use only. |