summaryrefslogtreecommitdiffstats
path: root/options/m_config.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-08-31 17:28:42 +0200
committerwm4 <wm4@nowhere>2016-08-31 22:16:43 +0200
commitb10dcecf7d71a076525bc2ac4b6bd72f4c453278 (patch)
treee638153d212784b4466934d254e5475a83cd98fe /options/m_config.c
parent7dde096d8a6d9e82cac82bec439fef47d078f352 (diff)
downloadmpv-b10dcecf7d71a076525bc2ac4b6bd72f4c453278.tar.bz2
mpv-b10dcecf7d71a076525bc2ac4b6bd72f4c453278.tar.xz
client API: deprecate "no-..." option handling
The client API can do this (and there are apparently some libmpv using projects which rely on this). But it's just unnecessary bloat as it requires a separate code path from the option parser. It would be better to remove this code. Formally deprecate it, including API bump and warning in the API changes file to make it really clear.
Diffstat (limited to 'options/m_config.c')
-rw-r--r--options/m_config.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/options/m_config.c b/options/m_config.c
index 470951d233..d1bb72c13b 100644
--- a/options/m_config.c
+++ b/options/m_config.c
@@ -707,6 +707,7 @@ int m_config_set_option_node(struct m_config *config, bstr name,
struct m_config_option *co = m_config_get_co(config, name);
if (!co) {
+ bstr orig_name = name;
co = m_config_find_negation_opt(config, &name);
if (!co)
return M_OPT_UNKNOWN;
@@ -716,6 +717,12 @@ int m_config_set_option_node(struct m_config *config, bstr name,
tmp.format = MPV_FORMAT_STRING;
tmp.u.string = "no";
data = &tmp;
+
+ if (!co->warning_was_printed) {
+ MP_WARN(config, "Option '%.*s': setting 'no-' option via API is "
+ "deprecated and will stop working.\n", BSTR_P(orig_name));
+ co->warning_was_printed = true;
+ }
}
// Do this on an "empty" type to make setting the option strictly overwrite