summaryrefslogtreecommitdiffstats
path: root/playlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/playlist.c b/playlist.c
index 27877cb8b3..55a0e5cf4a 100644
--- a/playlist.c
+++ b/playlist.c
@@ -162,14 +162,21 @@ struct playlist_entry *playlist_get_next(struct playlist *pl, int direction)
return pl->current_was_replaced ? pl->current : pl->current->next;
}
+static bool might_be_an_url(bstr f)
+{
+ return bstr_find0(f, "://") >= 0;
+}
+
void playlist_add_base_path(struct playlist *pl, bstr base_path)
{
if (base_path.len == 0 || bstrcmp0(base_path, ".") == 0)
return;
for (struct playlist_entry *e = pl->first; e; e = e->next) {
- char *new_file = mp_path_join(e, base_path, bstr0(e->filename));
- talloc_free(e->filename);
- e->filename = new_file;
+ if (!might_be_an_url(bstr0(e->filename))) {
+ char *new_file = mp_path_join(e, base_path, bstr0(e->filename));
+ talloc_free(e->filename);
+ e->filename = new_file;
+ }
}
}