aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlayerThread.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/PlayerThread.cxx')
-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();