summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-01-04 12:24:12 +0100
committerwm4 <wm4@nowhere>2019-09-19 20:37:04 +0200
commit4bc96e820497a39e552ccee2c7ca7d2953c01d36 (patch)
treebc81a9fdf6e53b7e045598d1133538424db95fb7 /player/command.c
parent8ca438636682b90de807dd1c46ad18cfab950c4b (diff)
downloadmpv-4bc96e820497a39e552ccee2c7ca7d2953c01d36.tar.bz2
mpv-4bc96e820497a39e552ccee2c7ca7d2953c01d36.tar.xz
command: make playlist builtin OSD property show titles instead of URLs
Useful for ytdl.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/player/command.c b/player/command.c
index d787242d48..dacdbed3f8 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2922,11 +2922,14 @@ static int mp_property_playlist(void *ctx, struct m_property *prop,
for (struct playlist_entry *e = pl->first; e; e = e->next)
{
- char *p = e->filename;
- if (!mp_is_url(bstr0(p))) {
- char *s = mp_basename(e->filename);
- if (s[0])
- p = s;
+ char *p = e->title;
+ if (!p) {
+ p = e->filename;
+ if (!mp_is_url(bstr0(p))) {
+ char *s = mp_basename(e->filename);
+ if (s[0])
+ p = s;
+ }
}
const char *m = pl->current == e ? list_current : list_normal;
res = talloc_asprintf_append(res, "%s%s\n", m, p);