mirror of
https://github.com/mpv-player/mpv
synced 2025-01-14 11:01:35 +00: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:
parent
812798c5ac
commit
b15143b7e0
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user