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. --- DOCS/client-api-changes.rst | 3 +++ DOCS/interface-changes.rst | 1 + libmpv/client.h | 2 +- options/m_config.c | 24 ++---------------------- 4 files changed, 7 insertions(+), 23 deletions(-) diff --git a/DOCS/client-api-changes.rst b/DOCS/client-api-changes.rst index f2a84a6acb..b94b3bf630 100644 --- a/DOCS/client-api-changes.rst +++ b/DOCS/client-api-changes.rst @@ -32,6 +32,9 @@ API changes :: + --- mpv 0.26.0 --- + 1.25 - remove setting "no-" options via mpv_set_option*(). (See corresponding + deprecation in 0.23.0.) --- mpv 0.25.0 --- 1.24 - add a MPV_ENABLE_DEPRECATED preprocessor symbol, which can be defined by the user to exclude deprecated API symbols from the C headers diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 698a5ff785..93894f2404 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -37,6 +37,7 @@ Interface changes - the "osd" command is deprecated (use "cycle osd-level") - --field-dominance is deprecated (use --vf=setfield=bff or tff) - --really-quiet subtle behavior change + - the deprecated handling of setting "no-" options via client API is dropped --- mpv 0.25.0 --- - remove opengl-cb dxva2 dummy hwdec interop (see git "vo_opengl: remove dxva2 dummy hwdec backend") diff --git a/libmpv/client.h b/libmpv/client.h index 8faa7b8129..eca0978fee 100644 --- a/libmpv/client.h +++ b/libmpv/client.h @@ -205,7 +205,7 @@ extern "C" { * relational operators (<, >, <=, >=). */ #define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL) -#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 24) +#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 25) /** * The API user is allowed to "#define MPV_ENABLE_DEPRECATED 0" before 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