From 5532d8cffe98817ac223187b7daad2f1d8d9c085 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 23 Mar 2018 15:33:51 +0100 Subject: command: remove an old compatibility hack Was removed 3 releases ago and was spamming warning messages that it'll be dropped, so it's fine to remove it now. --- DOCS/interface-changes.rst | 2 ++ player/command.c | 49 +--------------------------------------------- 2 files changed, 3 insertions(+), 48 deletions(-) diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index cfe58036db..268a34c686 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -80,6 +80,8 @@ Interface changes certain unreliable video metadata. Also flip the defaults of all builtin HW deinterlace filters to always deinterlace. - change vf_vavpp default to use the best deinterlace algorithm by default + - remove a compatibility hack that allowed CLI aliases to be set as property + (such as "sub-file"), deprecated in mpv 0.26.0 --- mpv 0.28.0 --- - rename --hwdec=mediacodec option to mediacodec-copy, to reflect conventions followed by other hardware video decoding APIs diff --git a/player/command.c b/player/command.c index 59f001025f..572930e69f 100644 --- a/player/command.c +++ b/player/command.c @@ -3605,37 +3605,6 @@ done: return mp_property_do(real_property, action, arg, ctx); } -static int mp_property_shitfuck(void *ctx, struct m_property *prop, - int action, void *arg) -{ - MPContext *mpctx = ctx; - int flags = M_SETOPT_RUNTIME; - const char *rname = prop->priv; - - MP_WARN(mpctx, "Do not use %s, use %s, bug reports will be ignored.\n", - prop->name, rname); - - struct m_config_option *co = m_config_get_co_raw(mpctx->mconfig, bstr0(rname)); - if (!co) - return M_PROPERTY_UNKNOWN; - - switch (action) { - case M_PROPERTY_GET_TYPE: - *(struct m_option *)arg = *(co->opt); - return M_PROPERTY_OK; - case M_PROPERTY_GET: - if (!co->data) - return M_PROPERTY_NOT_IMPLEMENTED; - m_option_copy(co->opt, arg, co->data); - return M_PROPERTY_OK; - case M_PROPERTY_SET: - if (m_config_set_option_raw_direct(mpctx->mconfig, co, arg, flags) < 0) - return M_PROPERTY_ERROR; - return M_PROPERTY_OK; - } - return M_PROPERTY_NOT_IMPLEMENTED; -} - static int access_options(struct m_property_action_arg *ka, bool local, MPContext *mpctx) { @@ -5600,8 +5569,7 @@ void command_init(struct MPContext *mpctx) for (int n = 0; n < num_opts; n++) { struct m_config_option *co = m_config_get_co_index(mpctx->mconfig, n); assert(co->name[0]); - if ((co->opt->flags & M_OPT_NOPROP) && - co->opt->type != &m_option_type_cli_alias) + if (co->opt->flags & M_OPT_NOPROP) continue; struct m_property prop = {0}; @@ -5616,21 +5584,6 @@ void command_init(struct MPContext *mpctx) .priv = (void *)alias, .is_option = true, }; - } else if (co->opt->type == &m_option_type_cli_alias) { - bstr rname = bstr0(co->opt->priv); - for (int i = rname.len - 1; i >= 0; i--) { - if (rname.start[i] == '-') { - rname.len = i; - break; - } - } - - prop = (struct m_property){ - .name = co->name, - .call = mp_property_shitfuck, - .priv = bstrto0(ctx, rname), - .is_option = true, - }; } else { prop = (struct m_property){ .name = co->name, -- cgit v1.2.3