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/PlayerControl.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/PlayerControl.cxx') diff --git a/src/PlayerControl.cxx b/src/PlayerControl.cxx index 96a221f6d..9ba77b32c 100644 --- a/src/PlayerControl.cxx +++ b/src/PlayerControl.cxx @@ -53,6 +53,9 @@ player_control::~player_control() { if (next_song != nullptr) next_song->Free(); + + if (tagged_song != nullptr) + tagged_song->Free(); } void @@ -200,6 +203,25 @@ player_control::ClearError() Unlock(); } +void +player_control::LockSetTaggedSong(const Song &song) +{ + Lock(); + if (tagged_song != nullptr) + tagged_song->Free(); + tagged_song = song.DupDetached(); + Unlock(); +} + +void +player_control::ClearTaggedSong() +{ + if (tagged_song != nullptr) { + tagged_song->Free(); + tagged_song = nullptr; + } +} + void player_control::EnqueueSong(Song *song) { -- cgit v1.2.3