From 8054c034b883b23e68fd8c9ca64749e9776f9fcf Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 23 May 2015 15:26:55 +0200 Subject: command: add protocol-list property Fixes #1972. --- player/command.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'player') 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}, -- cgit v1.2.3