player_thread: check command before waiting during pause

While paused, the player thread re-locks its mutex and waits for a
signal.  This is racy: when the command is set while the thread is
waiting for the lock, it may wait forever.  This patch adds another
command check before player_wait().
This commit is contained in:
Max Kellermann 2009-11-02 20:20:13 +01:00
parent b9013944dc
commit 408d52fe39

View File

@ -819,6 +819,8 @@ static void do_play(struct decoder_control *dc)
if (player.paused) {
player_lock();
if (pc.command == PLAYER_COMMAND_NONE)
player_wait();
continue;
} else if (music_pipe_size(player.pipe) > 0) {