From 8e82a64f5665dfeec2b0ae34b52f1870720f049e Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 10 Jul 2015 21:22:35 +0200 Subject: player: parse and expose m3u playlist titles Requested. Closes #2100. --- player/command.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'player') diff --git a/player/command.c b/player/command.c index c16f804883..0f3e455929 100644 --- a/player/command.c +++ b/player/command.c @@ -363,8 +363,6 @@ static int mp_property_media_title(void *ctx, struct m_property *prop, name = mpctx->opts->media_title; if (name && name[0]) return m_property_strdup_ro(action, arg, name); - if (name && name[0]) - return m_property_strdup_ro(action, arg, name); if (mpctx->master_demuxer) { name = mp_tags_get_str(mpctx->master_demuxer->metadata, "title"); if (name && name[0]) @@ -373,6 +371,8 @@ static int mp_property_media_title(void *ctx, struct m_property *prop, if (name && name[0]) return m_property_strdup_ro(action, arg, name); } + if (mpctx->playing && mpctx->playing->title) + return m_property_strdup_ro(action, arg, mpctx->playing->title); return mp_property_filename(ctx, prop, action, arg); } @@ -2923,6 +2923,7 @@ static int get_playlist_entry(int item, int action, void *arg, void *ctx) {"filename", SUB_PROP_STR(e->filename)}, {"current", SUB_PROP_FLAG(1), .unavailable = !current}, {"playing", SUB_PROP_FLAG(1), .unavailable = !playing}, + {"title", SUB_PROP_STR(e->title), .unavailable = !e->title}, {0} }; -- cgit v1.2.3