diff options
author | Max Kellermann <max@duempel.org> | 2010-01-06 07:59:46 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-01-06 08:00:02 +0100 |
commit | 8a5d2c3c836f89b4e96c70b57097cc86396e44d2 (patch) | |
tree | 376a54adea337322290aecbb4f53915af31649ff /src/playlist_queue.c | |
parent | 2f8135ef8bb4723e040571e38699300f21334127 (diff) | |
download | mpd-8a5d2c3c836f89b4e96c70b57097cc86396e44d2.tar.gz mpd-8a5d2c3c836f89b4e96c70b57097cc86396e44d2.tar.xz mpd-8a5d2c3c836f89b4e96c70b57097cc86396e44d2.zip |
playlist_queue: use the "uri" variable earlier
Preparation for the next patch.
Diffstat (limited to 'src/playlist_queue.c')
-rw-r--r-- | src/playlist_queue.c | 13 |
1 files changed, 7 insertions, 6 deletions
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); |