aboutsummaryrefslogtreecommitdiffstats
path: root/src/song.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/song.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/song.c b/src/song.c
index 13fd476b9..f5cc7c35a 100644
--- a/src/song.c
+++ b/src/song.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2010 The Music Player Daemon Project
+ * Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -61,6 +61,18 @@ song_file_new(const char *path, struct directory *parent)
return song_alloc(path, parent);
}
+struct song *
+song_replace_uri(struct song *old_song, const char *uri)
+{
+ struct song *new_song = song_alloc(uri, old_song->parent);
+ new_song->tag = old_song->tag;
+ new_song->mtime = old_song->mtime;
+ new_song->start_ms = old_song->start_ms;
+ new_song->end_ms = old_song->end_ms;
+ g_free(old_song);
+ return new_song;
+}
+
void
song_free(struct song *song)
{