Commit 7125fdc4 authored by Max Kellermann's avatar Max Kellermann

assert locked/unlocked in queue lock functions

There are no nested queue locks in mpd, thus replace the locked checks in playerQueueLock(), playerQueueUnlock() with assertions.
parent f1686956
......@@ -190,14 +190,17 @@ void setQueueState(enum player_queue_state queueState)
void playerQueueLock(void)
{
if (pc.queueLockState == PLAYER_QUEUE_UNLOCKED)
player_command(PLAYER_COMMAND_LOCK_QUEUE);
assert(pc.queueLockState == PLAYER_QUEUE_UNLOCKED);
player_command(PLAYER_COMMAND_LOCK_QUEUE);
assert(pc.queueLockState == PLAYER_QUEUE_LOCKED);
}
void playerQueueUnlock(void)
{
if (pc.queueLockState == PLAYER_QUEUE_LOCKED)
player_command(PLAYER_COMMAND_UNLOCK_QUEUE);
assert(pc.queueLockState == PLAYER_QUEUE_UNLOCKED);
}
int playerSeek(int fd, Song * song, float seek_time)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment