From 6f80a694d3de98ce9ddabf1c188865fc6be69710 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 26 Jun 2017 19:55:40 +0200 Subject: 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. --- options/m_config.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'options') 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. -- cgit v1.2.3