summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-02 17:44:24 +0100
committerwm4 <wm4@nowhere>2014-11-02 17:44:24 +0100
commit3a95a0887c95b1d1ab505a568c922c7a514f5916 (patch)
tree21994e5bde3bf28407647d4adf704dcf83f9113a /player/command.c
parent12212a1685155c67049a0f30f14b7bf789a8c093 (diff)
downloadmpv-3a95a0887c95b1d1ab505a568c922c7a514f5916.tar.bz2
mpv-3a95a0887c95b1d1ab505a568c922c7a514f5916.tar.xz
command: expose mpv version as property
A client API user has no other way to know the version.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c
index 2995f094a0..aa44196925 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2891,6 +2891,12 @@ static int mp_property_af(void *ctx, struct m_property *prop,
return property_filter(prop, action, arg, ctx, STREAM_AUDIO);
}
+static int mp_property_version(void *ctx, struct m_property *prop,
+ int action, void *arg)
+{
+ return m_property_strdup_ro(action, arg, mpv_version);
+}
+
static int mp_property_alias(void *ctx, struct m_property *prop,
int action, void *arg)
{
@@ -3160,6 +3166,8 @@ static const struct m_property mp_properties[] = {
M_PROPERTY_ALIAS("audio", "aid"),
M_PROPERTY_ALIAS("sub", "sid"),
+ {"mpv-version", mp_property_version},
+
{"options", mp_property_options},
{"file-local-options", mp_property_local_options},
{"property-list", mp_property_list},