queue/Playlist: cast next_song to bool, because that is all we need in SyncWithPlayer()
This commit is contained in:
parent
624e679e35
commit
b652ad9568
@ -178,7 +178,7 @@ playlist::SyncWithPlayer(PlayerControl &pc)
|
|||||||
|
|
||||||
pc.Lock();
|
pc.Lock();
|
||||||
const PlayerState pc_state = pc.GetState();
|
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();
|
pc.Unlock();
|
||||||
|
|
||||||
if (pc_state == PlayerState::STOP)
|
if (pc_state == PlayerState::STOP)
|
||||||
@ -190,16 +190,16 @@ playlist::SyncWithPlayer(PlayerControl &pc)
|
|||||||
else {
|
else {
|
||||||
/* check if the player thread has already started
|
/* check if the player thread has already started
|
||||||
playing the queued song */
|
playing the queued song */
|
||||||
if (pc_next_song == nullptr && queued != -1)
|
if (!pc_has_next_song && queued != -1)
|
||||||
QueuedSongStarted(pc);
|
QueuedSongStarted(pc);
|
||||||
|
|
||||||
pc.Lock();
|
pc.Lock();
|
||||||
pc_next_song = pc.next_song;
|
pc_has_next_song = pc.next_song != nullptr;
|
||||||
pc.Unlock();
|
pc.Unlock();
|
||||||
|
|
||||||
/* make sure the queued song is always set (if
|
/* make sure the queued song is always set (if
|
||||||
possible) */
|
possible) */
|
||||||
if (pc_next_song == nullptr && queued < 0)
|
if (!pc_has_next_song && queued < 0)
|
||||||
UpdateQueuedSong(pc, nullptr);
|
UpdateQueuedSong(pc, nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user