From 4cae19237758a21685c9d988d24dafac713f3a30 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 10 Nov 2019 23:49:23 +0100 Subject: 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. --- options/m_config.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'options/m_config.c') diff --git a/options/m_config.c b/options/m_config.c index ce74b791c6..3fe8a67235 100644 --- a/options/m_config.c +++ b/options/m_config.c @@ -725,9 +725,6 @@ static int handle_set_opt_flags(struct m_config *config, (co->is_set_from_cmdline || co->is_set_from_config)) set = false; - if ((flags & M_SETOPT_NO_FIXED) && (optflags & M_OPT_FIXED)) - return M_OPT_INVALID; - if ((flags & M_SETOPT_NO_PRE_PARSE) && (optflags & M_OPT_PRE_PARSE)) return M_OPT_INVALID; @@ -1100,8 +1097,6 @@ void m_config_print_option_list(const struct m_config *config, const char *name) MP_INFO(config, " [not in config files]"); if (opt->flags & M_OPT_FILE) MP_INFO(config, " [file]"); - if (opt->flags & M_OPT_FIXED) - MP_INFO(config, " [no runtime changes]"); if (opt->type == &m_option_type_alias) MP_INFO(config, " for %s", (char *)opt->priv); if (opt->type == &m_option_type_cli_alias) -- cgit v1.2.3