aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist_song.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/playlist_song.c')
-rw-r--r--src/playlist_song.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/playlist_song.c b/src/playlist_song.c
index a3d9ab4d9..2e2870d38 100644
--- a/src/playlist_song.c
+++ b/src/playlist_song.c
@@ -86,9 +86,7 @@ apply_song_metadata(struct song *dest, const struct song *src)
(e.g. last track on a CUE file); fix it up here */
tmp->tag->time = dest->tag->time - src->start_ms / 1000;
- if (!song_in_database(dest))
- song_free(dest);
-
+ song_free(dest);
return tmp;
}
@@ -104,10 +102,13 @@ playlist_check_load_song(const struct song *song, const char *uri, bool secure)
if (dest == NULL)
return NULL;
} else {
- dest = db_get_song(uri);
- if (dest == NULL)
+ struct song *tmp = db_get_song(uri);
+ if (tmp == NULL)
/* not found in database */
return NULL;
+
+ dest = song_dup_detached(tmp);
+ db_return_song(tmp);
}
return apply_song_metadata(dest, song);