From 8a5d2c3c836f89b4e96c70b57097cc86396e44d2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 6 Jan 2010 07:59:46 +0100 Subject: playlist_queue: use the "uri" variable earlier Preparation for the next patch. --- src/playlist_queue.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/playlist_queue.c b/src/playlist_queue.c index 327cdcacc..269b34553 100644 --- a/src/playlist_queue.c +++ b/src/playlist_queue.c @@ -83,14 +83,15 @@ static struct song * check_translate_song(struct song *song, const char *base_uri) { struct song *dest; - char *uri; if (song_in_database(song)) /* already ok */ return song; - if (uri_has_scheme(song->uri)) { - if (uri_supported_scheme(song->uri)) + char *uri = song->uri; + + if (uri_has_scheme(uri)) { + if (uri_supported_scheme(uri)) /* valid remote song */ return song; else { @@ -100,7 +101,7 @@ check_translate_song(struct song *song, const char *base_uri) } } - if (g_path_is_absolute(song->uri)) { + if (g_path_is_absolute(uri)) { /* local files must be relative to the music directory */ song_free(song); @@ -108,9 +109,9 @@ check_translate_song(struct song *song, const char *base_uri) } if (base_uri != NULL) - uri = g_build_filename(base_uri, song->uri, NULL); + uri = g_build_filename(base_uri, uri, NULL); else - uri = g_strdup(song->uri); + uri = g_strdup(uri); if (uri_has_scheme(base_uri)) { dest = song_remote_new(uri); -- cgit v1.2.3