summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-13 16:18:40 +0100
committerwm4 <wm4@nowhere>2014-11-13 16:18:40 +0100
commit23e0682dd4e0bf61a45d9c907ede2361dac28f5e (patch)
treed78554e5d09b95f2dac7cb9a7e90631545811c10
parent0f30803172011bc7f33d1e382f1ef0302e9d442b (diff)
downloadmpv-23e0682dd4e0bf61a45d9c907ede2361dac28f5e.tar.bz2
mpv-23e0682dd4e0bf61a45d9c907ede2361dac28f5e.tar.xz
command: export mpv configure arguments as property
It seems strange that a client API user can't get this string, other than analyzing the mpv log output.
-rw-r--r--DOCS/man/input.rst4
-rw-r--r--player/command.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst
index 21d0751447..f58ac0dda3 100644
--- a/DOCS/man/input.rst
+++ b/DOCS/man/input.rst
@@ -1422,6 +1422,10 @@ Property list
Return the mpv version/copyright string. Depending on how the binary was
built, it might contain either a release version, or just a git hash.
+``mpv-configuration``
+ Return the configuration arguments which were passed to the build system
+ (typically the way ``./waf configure ...`` was invoked).
+
``options/<name>`` (RW)
Read-only access to value of option ``--<name>``. Most options can be
changed at runtime by writing to this property. Note that many options
diff --git a/player/command.c b/player/command.c
index 4bbb46860d..f53cec04c3 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2932,6 +2932,12 @@ static int mp_property_version(void *ctx, struct m_property *prop,
return m_property_strdup_ro(action, arg, mpv_version);
}
+static int mp_property_configuration(void *ctx, struct m_property *prop,
+ int action, void *arg)
+{
+ return m_property_strdup_ro(action, arg, CONFIGURATION);
+}
+
static int mp_property_alias(void *ctx, struct m_property *prop,
int action, void *arg)
{
@@ -3232,6 +3238,7 @@ static const struct m_property mp_properties[] = {
{"display-names", mp_property_display_names},
{"mpv-version", mp_property_version},
+ {"mpv-configuration", mp_property_configuration},
{"options", mp_property_options},
{"file-local-options", mp_property_local_options},