summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-29 23:03:39 +0100
committerwm4 <wm4@nowhere>2014-12-29 23:03:39 +0100
commit97ab40290eaf5d5f2c97a7a7c6678cdee2283e79 (patch)
treef354cef7ce2a90f110c166e810b571dc679f9778 /player/command.c
parent8048374a5c1eb3af80aa057dcfd20deed39447c8 (diff)
downloadmpv-97ab40290eaf5d5f2c97a7a7c6678cdee2283e79.tar.bz2
mpv-97ab40290eaf5d5f2c97a7a7c6678cdee2283e79.tar.xz
command: add filtered-metadata property
Goes in hand with the previous commit; the main purpose is to easily show on OSD what is shown on terminal.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/player/command.c b/player/command.c
index 4e5fdc6509..97b890af5c 100644
--- a/player/command.c
+++ b/player/command.c
@@ -1122,6 +1122,16 @@ static int mp_property_metadata(void *ctx, struct m_property *prop,
return tag_property(action, arg, demuxer->metadata);
}
+static int mp_property_filtered_metadata(void *ctx, struct m_property *prop,
+ int action, void *arg)
+{
+ MPContext *mpctx = ctx;
+ if (!mpctx->filtered_tags)
+ return M_PROPERTY_UNAVAILABLE;
+
+ return tag_property(action, arg, mpctx->filtered_tags);
+}
+
static int mp_property_chapter_metadata(void *ctx, struct m_property *prop,
int action, void *arg)
{
@@ -3246,6 +3256,7 @@ static const struct m_property mp_properties[] = {
{"editions", mp_property_editions},
{"angle", mp_property_angle},
{"metadata", mp_property_metadata},
+ {"filtered-metadata", mp_property_filtered_metadata},
{"chapter-metadata", mp_property_chapter_metadata},
{"vf-metadata", mp_property_vf_metadata},
{"pause", mp_property_pause},
@@ -3429,7 +3440,7 @@ static const char *const *const mp_event_property_change[] = {
"samplerate", "channels", "audio"),
E(MPV_EVENT_SEEK, "seeking"),
E(MPV_EVENT_PLAYBACK_RESTART, "seeking"),
- E(MPV_EVENT_METADATA_UPDATE, "metadata"),
+ E(MPV_EVENT_METADATA_UPDATE, "metadata", "filtered-metadata"),
E(MPV_EVENT_CHAPTER_CHANGE, "chapter", "chapter-metadata"),
E(MP_EVENT_CACHE_UPDATE, "cache", "cache-free", "cache-used", "cache-idle",
"demuxer-cache-duration", "demuxer-cache-idle"),