diff options
author | wm4 <wm4@nowhere> | 2015-07-10 21:22:35 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-07-10 21:22:35 +0200 |
commit | 8e82a64f5665dfeec2b0ae34b52f1870720f049e (patch) | |
tree | 2d7cc09097e15f260b6a594f72276299f1b25d9f /player | |
parent | c2b61876c4e880f4f95413debb74b5435241f2d1 (diff) | |
download | mpv-8e82a64f5665dfeec2b0ae34b52f1870720f049e.tar.bz2 mpv-8e82a64f5665dfeec2b0ae34b52f1870720f049e.tar.xz |
player: parse and expose m3u playlist titles
Requested. Closes #2100.
Diffstat (limited to 'player')
-rw-r--r-- | player/command.c | 5 |
1 files changed, 3 insertions, 2 deletions
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} }; |