aboutsummaryrefslogtreecommitdiffstats
path: root/src/song.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-12 19:47:22 +0100
committerMax Kellermann <max@duempel.org>2012-02-12 19:48:02 +0100
commitdf563db29406ee47a9d45ae5a01ef03cc52be478 (patch)
treee9664f137629756974427f5d144bc68437e0d301 /src/song.c
parent01b0d9eb975278a3f8c06ca7de01b8d80519df4a (diff)
downloadmpd-df563db29406ee47a9d45ae5a01ef03cc52be478.tar.gz
mpd-df563db29406ee47a9d45ae5a01ef03cc52be478.tar.xz
mpd-df563db29406ee47a9d45ae5a01ef03cc52be478.zip
song: add function song_replace_uri()
Diffstat (limited to 'src/song.c')
-rw-r--r--src/song.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/song.c b/src/song.c
index bddf8eb83..f5cc7c35a 100644
--- a/src/song.c
+++ b/src/song.c
@@ -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)
{