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.
This commit is contained in:
wm4 2017-06-26 19:55:40 +02:00
parent 4c17ed457d
commit 6f80a694d3
4 changed files with 7 additions and 23 deletions

View File

@ -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

View File

@ -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")

View File

@ -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

View File

@ -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.