summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-23 15:26:55 +0200
committerwm4 <wm4@nowhere>2015-05-23 15:26:55 +0200
commit8054c034b883b23e68fd8c9ca64749e9776f9fcf (patch)
treecb390f74e4ac4ccdf750a1943e4e0c1c91a4dd05 /player
parenta3f8d45fb6f70cc9d07105eeee8c843b9109bca6 (diff)
downloadmpv-8054c034b883b23e68fd8c9ca64749e9776f9fcf.tar.bz2
mpv-8054c034b883b23e68fd8c9ca64749e9776f9fcf.tar.xz
command: add protocol-list property
Fixes #1972.
Diffstat (limited to 'player')
-rw-r--r--player/command.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c
index 9ae3880b31..25b9a90e4a 100644
--- a/player/command.c
+++ b/player/command.c
@@ -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},