diff options
author | wm4 <wm4@nowhere> | 2014-12-27 21:19:52 +0100 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-01-25 17:00:15 +0900 |
commit | 3d949382468b9fbdb1de252ae218d00cd2227ed5 (patch) | |
tree | 0133b987ccee196b30cfeb36ad48a93d2735e920 | |
parent | d627c579ea73ed1984e5577f5322c4b0f0bde6bf (diff) | |
download | mpv-3d949382468b9fbdb1de252ae218d00cd2227ed5.tar.bz2 mpv-3d949382468b9fbdb1de252ae218d00cd2227ed5.tar.xz |
command: stip path from playlist OSD display
But only if it's not e.g. a http URL.
Fixes #1388.
-rw-r--r-- | player/command.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/player/command.c b/player/command.c index 71690e5bb3..bd63746669 100644 --- a/player/command.c +++ b/player/command.c @@ -2872,10 +2872,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); } } |