diff options
author | Max Kellermann <max@musicpd.org> | 2017-11-26 11:55:31 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-11-26 12:06:29 +0100 |
commit | b652ad9568051cd2e4f115af869c083e8aba8377 (patch) | |
tree | 4a3499793081a22aa188ff2916cc660faa548745 /src/queue/Playlist.cxx | |
parent | 624e679e35f8cd3ff6bdf86e7de11db58285e586 (diff) |
queue/Playlist: cast next_song to bool, because that is all we need in SyncWithPlayer()
Diffstat (limited to 'src/queue/Playlist.cxx')
-rw-r--r-- | src/queue/Playlist.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/queue/Playlist.cxx b/src/queue/Playlist.cxx index dfeb0d163..8cdcc9a74 100644 --- a/src/queue/Playlist.cxx +++ b/src/queue/Playlist.cxx @@ -178,7 +178,7 @@ playlist::SyncWithPlayer(PlayerControl &pc) pc.Lock(); const PlayerState pc_state = pc.GetState(); - const DetachedSong *pc_next_song = pc.next_song; + bool pc_has_next_song = pc.next_song != nullptr; pc.Unlock(); if (pc_state == PlayerState::STOP) @@ -190,16 +190,16 @@ playlist::SyncWithPlayer(PlayerControl &pc) else { /* check if the player thread has already started playing the queued song */ - if (pc_next_song == nullptr && queued != -1) + if (!pc_has_next_song && queued != -1) QueuedSongStarted(pc); pc.Lock(); - pc_next_song = pc.next_song; + pc_has_next_song = pc.next_song != nullptr; pc.Unlock(); /* make sure the queued song is always set (if possible) */ - if (pc_next_song == nullptr && queued < 0) + if (!pc_has_next_song && queued < 0) UpdateQueuedSong(pc, nullptr); } } |