aboutsummaryrefslogtreecommitdiffstats
path: root/src/Playlist.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-21 23:22:16 +0200
committerMax Kellermann <max@duempel.org>2013-10-22 00:02:21 +0200
commit2f43e4bc668f04a222500ab34536ef00149e209f (patch)
tree260593ec865b3f13b8cb11f86a86d23bb10ad2ad /src/Playlist.cxx
parentf8c23488c942a89df74b231307281cf1919fab61 (diff)
downloadmpd-2f43e4bc668f04a222500ab34536ef00149e209f.tar.gz
mpd-2f43e4bc668f04a222500ab34536ef00149e209f.tar.xz
mpd-2f43e4bc668f04a222500ab34536ef00149e209f.zip
Playlist: copy stream tags from the PlayerThread
Finally restores an important feature that has been broken for several months when the PlayerThread started working with Song copies instead of pointers to the Queue's Song instances (commit e96779d).
Diffstat (limited to 'src/Playlist.cxx')
-rw-r--r--src/Playlist.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Playlist.cxx b/src/Playlist.cxx
index 570d64b19..296b52769 100644
--- a/src/Playlist.cxx
+++ b/src/Playlist.cxx
@@ -22,6 +22,7 @@
#include "PlaylistError.hxx"
#include "PlayerControl.hxx"
#include "Song.hxx"
+#include "tag/Tag.hxx"
#include "Idle.hxx"
#include "Log.hxx"
@@ -35,13 +36,17 @@ playlist::FullIncrementVersions()
}
void
-playlist::TagChanged()
+playlist::TagModified(Song &&song)
{
- if (!playing)
+ if (!playing || song.tag == nullptr)
return;
assert(current >= 0);
+ Song &current_song = queue.GetOrder(current);
+ if (SongEquals(song, current_song))
+ current_song.ReplaceTag(std::move(*song.tag));
+
queue.ModifyAtOrder(current);
idle_add(IDLE_PLAYLIST);
}