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:
parent
b9013944dc
commit
408d52fe39
@ -819,7 +819,9 @@ static void do_play(struct decoder_control *dc)
|
|||||||
|
|
||||||
if (player.paused) {
|
if (player.paused) {
|
||||||
player_lock();
|
player_lock();
|
||||||
player_wait();
|
|
||||||
|
if (pc.command == PLAYER_COMMAND_NONE)
|
||||||
|
player_wait();
|
||||||
continue;
|
continue;
|
||||||
} else if (music_pipe_size(player.pipe) > 0) {
|
} else if (music_pipe_size(player.pipe) > 0) {
|
||||||
/* at least one music chunk is ready - send it
|
/* at least one music chunk is ready - send it
|
||||||
|
Loading…
Reference in New Issue
Block a user