summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-07 17:31:30 +0200
committerwm4 <wm4@nowhere>2013-06-07 17:49:35 +0200
commitb15143b7e0df6d9f6d0dc072e89d1c86d41f52d4 (patch)
tree025f2fc60cc5bece1f74bc66630bbe41a0c03bfb /core
parent812798c5ace0d0ffbdeea8fc603f31bf3fe70b79 (diff)
downloadmpv-b15143b7e0df6d9f6d0dc072e89d1c86d41f52d4.tar.bz2
mpv-b15143b7e0df6d9f6d0dc072e89d1c86d41f52d4.tar.xz
command: human readable output for metadata property
Slightly better output when printing ${metadata}. Print each metadata item as "name: value", instead of the raw list. It's still not very great, though. The old format is still available through ${=metadata} for things which dare to use the broken slave mode.
Diffstat (limited to 'core')
-rw-r--r--core/command.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/command.c b/core/command.c
index c5c818e6b7..2b902eef58 100644
--- a/core/command.c
+++ b/core/command.c
@@ -536,6 +536,16 @@ static int mp_property_metadata(m_option_t *prop, int action, void *arg,
*(char ***)arg = slist;
return M_PROPERTY_OK;
}
+ case M_PROPERTY_PRINT: {
+ char **list = demuxer->info;
+ char *res = NULL;
+ for (int n = 0; list[n]; n += 2) {
+ res = talloc_asprintf_append_buffer(res, "%s: %s\n",
+ list[n], list[n + 1]);
+ }
+ *(char **)arg = res;
+ return M_PROPERTY_OK;
+ }
case M_PROPERTY_KEY_ACTION: {
struct m_property_action_arg *ka = arg;
char *meta = demux_info_get(demuxer, ka->key);