summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-06-26 19:55:40 +0200
committerwm4 <wm4@nowhere>2017-06-26 20:07:20 +0200
commit6f80a694d3de98ce9ddabf1c188865fc6be69710 (patch)
treed6f1f5faf4da5a20701c06f7a25cccbf9fc1d12b /options
parent4c17ed457d3e7ee31bbeefa2d99ae6da75d2b21f (diff)
downloadmpv-6f80a694d3de98ce9ddabf1c188865fc6be69710.tar.bz2
mpv-6f80a694d3de98ce9ddabf1c188865fc6be69710.tar.xz
client API: drop old "no-" option emulation
You could do mpv_set_option(h, "no-fs", ""), which would behave like "--no-fs" on the command line. At one point, this had to be emulated for compatibility, and printed a deprecation warning. This was almost a year ago, so remove it.
Diffstat (limited to 'options')
-rw-r--r--options/m_config.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/options/m_config.c b/options/m_config.c
index dabea4647c..27bd5b620e 100644
--- a/options/m_config.c
+++ b/options/m_config.c
@@ -236,9 +236,6 @@ void *m_config_group_from_desc(void *ta_parent, struct mp_log *log,
}
}
-static struct m_config_option *m_config_find_negation_opt(struct m_config *config,
- struct bstr *name);
-
static int m_config_set_obj_params(struct m_config *config, struct mp_log *log,
struct mpv_global *global,
struct m_obj_desc *desc, char **args)
@@ -874,28 +871,11 @@ int m_config_set_option(struct m_config *config, struct bstr name,
int m_config_set_option_node(struct m_config *config, bstr name,
struct mpv_node *data, int flags)
{
- struct mpv_node tmp;
int r;
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;
- if (!(data->format == MPV_FORMAT_STRING && !bstr0(data->u.string).len) &&
- !(data->format == MPV_FORMAT_FLAG && data->u.flag == 1))
- return M_OPT_INVALID;
- 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;
- }
- }
+ if (!co)
+ return M_OPT_UNKNOWN;
// Do this on an "empty" type to make setting the option strictly overwrite
// the old value, as opposed to e.g. appending to lists.