0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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.
This commit is contained in:
wm4 2013-06-07 17:31:30 +02:00
parent 812798c5ac
commit b15143b7e0

View File

@ -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);