summaryrefslogtreecommitdiffstats
path: root/options/m_config.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-08-31 18:10:11 +0200
committerwm4 <wm4@nowhere>2016-08-31 22:17:21 +0200
commitc55d85992078e465f9e0b7b6998ccdc5f5e77703 (patch)
treedb6a4939daa1c3c0b810710b5d268592a8c29262 /options/m_config.c
parent2057209057555dc138422daa354fe8db816c629c (diff)
downloadmpv-c55d85992078e465f9e0b7b6998ccdc5f5e77703.tar.bz2
mpv-c55d85992078e465f9e0b7b6998ccdc5f5e77703.tar.xz
m_option: replace --no-video-aspect alias
Instead, add a hacky OPT_ASPECT option type, which only exists to accept a "no" parameter, which in combination with the "--no-..." handling code makes --no-video-aspect work again. We can also remove the code in m_config.c, which only existed to make "--no-aspect" (a deprecated alias) to work.
Diffstat (limited to 'options/m_config.c')
-rw-r--r--options/m_config.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/options/m_config.c b/options/m_config.c
index 4912b21cf6..b5cef17fd8 100644
--- a/options/m_config.c
+++ b/options/m_config.c
@@ -396,20 +396,6 @@ static void m_config_add_option(struct m_config *config,
if (arg->name[0]) // no own name -> hidden
MP_TARRAY_APPEND(config, config->opts, config->num_opts, co);
-
- if (co.opt->type == &m_option_type_alias) {
- const char *alias = (const char *)co.opt->priv;
- char no_alias[40];
- snprintf(no_alias, sizeof(no_alias), "no-%s", alias);
- if (m_config_get_co(config, bstr0(no_alias))) {
- struct m_option *new = talloc_zero(config, struct m_option);
- new->name = talloc_asprintf(config, "no-%s", co.name);
- new->priv = talloc_strdup(config, no_alias);
- new->type = &m_option_type_alias;
- new->offset = -1;
- m_config_add_option(config, NULL, NULL, NULL, new);
- }
- }
}
struct m_config_option *m_config_get_co(const struct m_config *config,
@@ -578,7 +564,8 @@ static struct m_config_option *m_config_find_negation_opt(struct m_config *confi
// Not all choice types have this value - if they don't, then parsing them
// will simply result in an error. Good enough.
if (co && co->opt->type != CONF_TYPE_FLAG &&
- co->opt->type != CONF_TYPE_CHOICE)
+ co->opt->type != CONF_TYPE_CHOICE &&
+ co->opt->type != &m_option_type_aspect)
co = NULL;
return co;