summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-27 21:19:52 +0100
committerwm4 <wm4@nowhere>2014-12-27 21:20:57 +0100
commita608a0cd8e8b28d5b42d9e07168c307d7a2ffc73 (patch)
tree2747458a53ac93d23670a39ce7d21a2f75bd9c9f /player
parented253beef005ec297125f03a60bd5bf9a5e8b6b6 (diff)
downloadmpv-a608a0cd8e8b28d5b42d9e07168c307d7a2ffc73.tar.bz2
mpv-a608a0cd8e8b28d5b42d9e07168c307d7a2ffc73.tar.xz
command: stip path from playlist OSD display
But only if it's not e.g. a http URL. Fixes #1388.
Diffstat (limited to 'player')
-rw-r--r--player/command.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/player/command.c b/player/command.c
index 2a7ac5b82b..dbf9167fff 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2922,10 +2922,16 @@ static int mp_property_playlist(void *ctx, struct m_property *prop,
for (struct playlist_entry *e = mpctx->playlist->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;
+ }
if (mpctx->playlist->current == e) {
- res = talloc_asprintf_append(res, "> %s <\n", e->filename);
+ res = talloc_asprintf_append(res, "> %s <\n", p);
} else {
- res = talloc_asprintf_append(res, "%s\n", e->filename);
+ res = talloc_asprintf_append(res, "%s\n", p);
}
}