summaryrefslogtreecommitdiffstats
path: root/mpvcore/playlist.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-04 14:04:35 +0200
committerwm4 <wm4@nowhere>2013-09-04 16:15:08 +0200
commitefc5ac17bf0a563cc4200252e8d4718731dc9fde (patch)
tree86eeedc8abf1170b2c91abda2df632a0458e8eb6 /mpvcore/playlist.c
parentdbff29c81d3127d69e97abcf7001f4b798898a81 (diff)
downloadmpv-efc5ac17bf0a563cc4200252e8d4718731dc9fde.tar.bz2
mpv-efc5ac17bf0a563cc4200252e8d4718731dc9fde.tar.xz
path: add a common mp_is_url() function
Remove the duplicated code.
Diffstat (limited to 'mpvcore/playlist.c')
-rw-r--r--mpvcore/playlist.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/mpvcore/playlist.c b/mpvcore/playlist.c
index 77e114b1a5..3396a5d78b 100644
--- a/mpvcore/playlist.c
+++ b/mpvcore/playlist.c
@@ -176,17 +176,12 @@ 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) {
- if (!might_be_an_url(bstr0(e->filename))) {
+ if (!mp_is_url(bstr0(e->filename))) {
char *new_file = mp_path_join(e, base_path, bstr0(e->filename));
talloc_free(e->filename);
e->filename = new_file;