summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-02-24 21:18:53 +0100
committerwm4 <wm4@nowhere>2014-02-24 22:50:24 +0100
commit4d1575173b64b7a95f7cf9626956aebafdbc103f (patch)
tree9e8260eae1b5796c92392eb1d4a0b52f4417130b /player
parent38a36fd7ea4a4d9bd4f8ea659f846b7d8784e27b (diff)
downloadmpv-4d1575173b64b7a95f7cf9626956aebafdbc103f.tar.bz2
mpv-4d1575173b64b7a95f7cf9626956aebafdbc103f.tar.xz
command: make options property return the list of all options
Diffstat (limited to 'player')
-rw-r--r--player/command.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/player/command.c b/player/command.c
index 4d4f552ffa..bb63b8863a 100644
--- a/player/command.c
+++ b/player/command.c
@@ -1977,14 +1977,8 @@ static int mp_property_alias(m_option_t *prop, int action, void *arg,
return mp_property_do(real_property, action, arg, mpctx);
}
-static int mp_property_options(m_option_t *prop, int action, void *arg,
- MPContext *mpctx)
+static int access_options(struct m_property_action_arg *ka, MPContext *mpctx)
{
- if (action != M_PROPERTY_KEY_ACTION)
- return M_PROPERTY_NOT_IMPLEMENTED;
-
- struct m_property_action_arg *ka = arg;
-
struct m_config_option *opt = m_config_get_co(mpctx->mconfig,
bstr0(ka->key));
if (!opt)
@@ -2008,7 +2002,22 @@ static int mp_property_options(m_option_t *prop, int action, void *arg,
*(struct m_option *)ka->arg = *opt->opt;
return M_PROPERTY_OK;
}
+ return M_PROPERTY_NOT_IMPLEMENTED;
+}
+static int mp_property_options(m_option_t *prop, int action, void *arg,
+ MPContext *mpctx)
+{
+ switch (action) {
+ case M_PROPERTY_GET_TYPE:
+ *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_STRING_LIST};
+ return M_PROPERTY_OK;
+ case M_PROPERTY_GET:
+ *(char ***)arg = m_config_list_options(NULL, mpctx->mconfig);
+ return M_PROPERTY_OK;
+ case M_PROPERTY_KEY_ACTION:
+ return access_options(arg, mpctx);
+ }
return M_PROPERTY_NOT_IMPLEMENTED;
}