diff options
author | Max Kellermann <max@duempel.org> | 2013-10-14 20:54:05 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-14 21:00:46 +0200 |
commit | 7cbaf11ddad6f5b464baed80b80e8c9b62f53d55 (patch) | |
tree | ccfc897a1cf158eeb37227b5a33db1af44d607a9 | |
parent | 3be63549c07c52536689f61edf502d1773549616 (diff) | |
download | mpd-7cbaf11ddad6f5b464baed80b80e8c9b62f53d55.tar.gz mpd-7cbaf11ddad6f5b464baed80b80e8c9b62f53d55.tar.xz mpd-7cbaf11ddad6f5b464baed80b80e8c9b62f53d55.zip |
load_file
Diffstat (limited to '')
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | src/playlist_save.c | 11 |
2 files changed, 13 insertions, 0 deletions
@@ -1,6 +1,8 @@ ver 0.17.6 (not yet released) * mixer: - alsa: fix busy loop when USB sound device gets unplugged +* stored playlists: + - fix loading playlists with references to local files ver 0.17.5 (2013/08/04) * protocol: diff --git a/src/playlist_save.c b/src/playlist_save.c index 334159e0d..194bff057 100644 --- a/src/playlist_save.c +++ b/src/playlist_save.c @@ -32,6 +32,8 @@ #include <glib.h> +#include <string.h> + void playlist_print_song(FILE *file, const struct song *song) { @@ -128,6 +130,15 @@ playlist_load_spl(struct playlist *playlist, struct player_control *pc, for (unsigned i = start_index; i < end_index; ++i) { const char *temp = g_ptr_array_index(list, i); + + if (memcmp(temp, "file:///", 8) == 0) { + const char *path = temp + 7; + + if (playlist_append_file(playlist, pc, path, NULL) != PLAYLIST_RESULT_SUCCESS) + g_warning("can't add file \"%s\"", path); + continue; + } + if ((playlist_append_uri(playlist, pc, temp, NULL)) != PLAYLIST_RESULT_SUCCESS) { /* for windows compatibility, convert slashes */ char *temp2 = g_strdup(temp); |