diff options
author | Max Kellermann <max@duempel.org> | 2013-10-21 23:22:16 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-22 00:02:21 +0200 |
commit | 2f43e4bc668f04a222500ab34536ef00149e209f (patch) | |
tree | 260593ec865b3f13b8cb11f86a86d23bb10ad2ad /src/PlayerControl.cxx | |
parent | f8c23488c942a89df74b231307281cf1919fab61 (diff) | |
download | mpd-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/PlayerControl.cxx')
-rw-r--r-- | src/PlayerControl.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
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 @@ -201,6 +204,25 @@ player_control::ClearError() } 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) { assert(song != nullptr); |