From 2f43e4bc668f04a222500ab34536ef00149e209f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 21 Oct 2013 23:22:16 +0200 Subject: 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). --- src/PlayerThread.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/PlayerThread.cxx') 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(); -- cgit v1.2.3