command: stip path from playlist OSD display

But only if it's not e.g. a http URL.

Fixes #1388.
This commit is contained in:
wm4 2014-12-27 21:19:52 +01:00 committed by Diogo Franco (Kovensky)
parent d627c579ea
commit 3d94938246
1 changed files with 8 additions and 2 deletions

View File

@ -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) 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) { if (mpctx->playlist->current == e) {
res = talloc_asprintf_append(res, "> %s <\n", e->filename); res = talloc_asprintf_append(res, "> %s <\n", p);
} else { } else {
res = talloc_asprintf_append(res, "%s\n", e->filename); res = talloc_asprintf_append(res, "%s\n", p);
} }
} }