aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlayerThread.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/PlayerThread.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 '')
-rw-r--r--src/PlayerThread.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/PlayerThread.cxx b/src/PlayerThread.cxx
index 4f5b15bba..35f697c45 100644
--- a/src/PlayerThread.cxx
+++ b/src/PlayerThread.cxx
@@ -335,6 +335,8 @@ Player::WaitForDecoder()
return false;
}
+ pc.ClearTaggedSong();
+
if (song != nullptr)
song->Free();
@@ -684,7 +686,7 @@ Player::ProcessCommand()
}
static void
-update_song_tag(Song *song, const Tag &new_tag)
+update_song_tag(player_control &pc, Song *song, const Tag &new_tag)
{
if (song->IsFile())
/* don't update tags of local files, only remote
@@ -696,6 +698,8 @@ update_song_tag(Song *song, const Tag &new_tag)
delete old_tag;
+ pc.LockSetTaggedSong(*song);
+
/* the main thread will update the playlist version when he
receives this event */
GlobalEvents::Emit(GlobalEvents::TAG);
@@ -722,7 +726,7 @@ play_chunk(player_control &pc,
assert(chunk->CheckFormat(format));
if (chunk->tag != nullptr)
- update_song_tag(song, *chunk->tag);
+ update_song_tag(pc, song, *chunk->tag);
if (chunk->IsEmpty()) {
buffer.Return(chunk);
@@ -1077,6 +1081,8 @@ Player::Run()
pc.Lock();
+ pc.ClearTaggedSong();
+
if (queued) {
assert(pc.next_song != nullptr);
pc.next_song->Free();