diff options
author | wm4 <wm4@nowhere> | 2014-02-21 13:18:50 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-02-23 16:49:47 +0100 |
commit | f225b5fc005dda92902343e0ec9de8d5b82d89c1 (patch) | |
tree | a0b67a07c772d5f8884bd069ecf4dee850e72e18 /options | |
parent | 0d4ec7d6657d7aef78a874cdd2e31ca1dad24081 (diff) | |
download | mpv-f225b5fc005dda92902343e0ec9de8d5b82d89c1.tar.bz2 mpv-f225b5fc005dda92902343e0ec9de8d5b82d89c1.tar.xz |
command: don't use option name in properties
Some code accessed m_option.name to get the property name. (Maybe only
show_property_osd() had a significant use of it.) Remove that, and
remove setting names and dummy names as well.
The old code usually assumed that the name was set, and
show_property_osd() used it to get the proper name of deprecated
aliases.
The "vf" property was listed as "vf*". Not sure why that was done, but
it works without anyway.
Diffstat (limited to 'options')
-rw-r--r-- | options/m_property.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/options/m_property.c b/options/m_property.c index 308bed55e0..225296db89 100644 --- a/options/m_property.c +++ b/options/m_property.c @@ -37,7 +37,6 @@ const struct m_option_type m_option_type_dummy = { .name = "Unknown", - .flags = M_OPT_TYPE_ALLOW_WILDCARD, // make "vf*" property work }; struct legacy_prop { @@ -395,10 +394,7 @@ int m_property_read_sub(const struct m_sub_property *props, int action, void *ar { switch (action) { case M_PROPERTY_GET_TYPE: - *(struct m_option *)arg = (struct m_option){ - .name = "", - .type = CONF_TYPE_STRING, - }; + *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_STRING}; return M_PROPERTY_OK; case M_PROPERTY_GET: case M_PROPERTY_PRINT: { @@ -411,7 +407,7 @@ int m_property_read_sub(const struct m_sub_property *props, int action, void *ar const struct m_sub_property *prop = &props[n]; if (prop->unavailable) continue; - struct m_option type = { .name = "", .type = prop->type, }; + struct m_option type = {.type = prop->type}; char *s = m_option_print(&type, &prop->value); ta_xasprintf_append(&res, "%s=%s\n", prop->name, s); talloc_free(s); @@ -432,7 +428,7 @@ int m_property_read_sub(const struct m_sub_property *props, int action, void *ar return M_PROPERTY_UNKNOWN; if (prop->unavailable) return M_PROPERTY_UNAVAILABLE; - struct m_option type = { .name = "", .type = prop->type, }; + struct m_option type = {.type = prop->type}; switch (ka->action) { case M_PROPERTY_GET: { memset(ka->arg, 0, type.type->size); @@ -462,10 +458,7 @@ int m_property_read_list(int action, void *arg, int count, { switch (action) { case M_PROPERTY_GET_TYPE: - *(struct m_option *)arg = (struct m_option){ - .name = "", - .type = CONF_TYPE_STRING, - }; + *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_STRING}; return M_PROPERTY_OK; case M_PROPERTY_GET: case M_PROPERTY_PRINT: { @@ -489,10 +482,7 @@ int m_property_read_list(int action, void *arg, int count, if (strcmp(ka->key, "count") == 0) { switch (ka->action) { case M_PROPERTY_GET_TYPE: { - struct m_option opt = { - .name = "", - .type = CONF_TYPE_INT, - }; + struct m_option opt = {.type = CONF_TYPE_INT}; *(struct m_option *)ka->arg = opt; return M_PROPERTY_OK; } |