command: add protocol-list property

Fixes #1972.
This commit is contained in:
wm4
2015-05-23 15:26:55 +02:00
parent a3f8d45fb6
commit 8054c034b8
5 changed files with 45 additions and 6 deletions

View File

@@ -3063,6 +3063,20 @@ static int mp_property_cwd(void *ctx, struct m_property *prop,
return M_PROPERTY_NOT_IMPLEMENTED;
}
static int mp_property_protocols(void *ctx, struct m_property *prop,
int action, void *arg)
{
switch (action) {
case M_PROPERTY_GET:
*(char ***)arg = stream_get_proto_list();
return M_PROPERTY_OK;
case M_PROPERTY_GET_TYPE:
*(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_STRING_LIST};
return M_PROPERTY_OK;
}
return M_PROPERTY_NOT_IMPLEMENTED;
}
static int mp_property_version(void *ctx, struct m_property *prop,
int action, void *arg)
{
@@ -3465,6 +3479,8 @@ static const struct m_property mp_properties[] = {
{"working-directory", mp_property_cwd},
{"protocol-list", mp_property_protocols},
{"mpv-version", mp_property_version},
{"mpv-configuration", mp_property_configuration},