From 3be63549c07c52536689f61edf502d1773549616 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 14 Oct 2013 20:52:49 +0200 Subject: stored_playlist: add "file://" prefix to absolute paths Prepare to fix loading arbitrary song files from stored playlists. --- src/stored_playlist.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/stored_playlist.c b/src/stored_playlist.c index 39ba2bac1..e84d5e060 100644 --- a/src/stored_playlist.c +++ b/src/stored_playlist.c @@ -272,7 +272,14 @@ spl_load(const char *utf8path, GError **error_r) if (*s == 0 || *s == PLAYLIST_COMMENT) continue; - if (!uri_has_scheme(s)) { + if (g_path_is_absolute(s)) { + char *t = fs_charset_to_utf8(s); + if (t == NULL) + continue; + + s = g_strconcat("file://", t, NULL); + g_free(t); + } else if (!uri_has_scheme(s)) { char *path_utf8; path_utf8 = map_fs_to_utf8(s); -- cgit v1.2.3 From 7cbaf11ddad6f5b464baed80b80e8c9b62f53d55 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 14 Oct 2013 20:54:05 +0200 Subject: load_file --- NEWS | 2 ++ src/playlist_save.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/NEWS b/NEWS index d59b6ae7f..4ab825be6 100644 --- a/NEWS +++ b/NEWS @@ -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 +#include + 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); -- cgit v1.2.3 From ad631d563bbbdb4aef8bcaf7f02d009b1bc5d06f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 14 Oct 2013 21:11:20 +0200 Subject: stored_playlist: use fs_charset_to_utf8() for URLs --- NEWS | 1 + src/stored_playlist.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 4ab825be6..c1acf0fd9 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ ver 0.17.6 (not yet released) - alsa: fix busy loop when USB sound device gets unplugged * stored playlists: - fix loading playlists with references to local files + - obey filesystem_charset for URLs ver 0.17.5 (2013/08/04) * protocol: diff --git a/src/stored_playlist.c b/src/stored_playlist.c index e84d5e060..86b7ff8c3 100644 --- a/src/stored_playlist.c +++ b/src/stored_playlist.c @@ -287,8 +287,11 @@ spl_load(const char *utf8path, GError **error_r) continue; s = path_utf8; - } else - s = g_strdup(s); + } else { + s = fs_charset_to_utf8(s); + if (s == NULL) + continue; + } g_ptr_array_add(list, s); -- cgit v1.2.3 From d9c662d51f2f8f7795875ddfb3dcc0f772717267 Mon Sep 17 00:00:00 2001 From: Florian Schlichting Date: Mon, 14 Oct 2013 21:12:47 +0200 Subject: decoder/modplug: fix include directory --- NEWS | 2 ++ src/decoder/modplug_decoder_plugin.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index c1acf0fd9..b2cc0d15a 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ ver 0.17.6 (not yet released) * mixer: - alsa: fix busy loop when USB sound device gets unplugged +* decoder: + - modplug: fix build with Debian package 1:0.8.8.4-4 * stored playlists: - fix loading playlists with references to local files - obey filesystem_charset for URLs diff --git a/src/decoder/modplug_decoder_plugin.c b/src/decoder/modplug_decoder_plugin.c index 21ee79e7e..5ae4b1a04 100644 --- a/src/decoder/modplug_decoder_plugin.c +++ b/src/decoder/modplug_decoder_plugin.c @@ -22,7 +22,7 @@ #include "tag_handler.h" #include -#include +#include #include #undef G_LOG_DOMAIN -- cgit v1.2.3 From 681352ac3bc2abe12ebabbf6e4e3258384beb65b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 14 Oct 2013 21:15:55 +0200 Subject: release 0.17.6 --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index b2cc0d15a..aebf7a35d 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ver 0.17.6 (not yet released) +ver 0.17.6 (2013/10/14) * mixer: - alsa: fix busy loop when USB sound device gets unplugged * decoder: -- cgit v1.2.3