diff options
author | Max Kellermann <max@duempel.org> | 2009-11-02 17:01:17 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-11-02 17:01:17 +0100 |
commit | d1742a2330af968c8ca453855ad0604f4998428b (patch) | |
tree | 29243de279d77d8af5f4228479d348cf9b27de73 /src | |
parent | 5555d30bbd492be4241779578327a7fe3a7d99a1 (diff) | |
download | mpd-d1742a2330af968c8ca453855ad0604f4998428b.tar.gz mpd-d1742a2330af968c8ca453855ad0604f4998428b.tar.xz mpd-d1742a2330af968c8ca453855ad0604f4998428b.zip |
output_thread: check command before g_cond_wait()
After CANCEL, call g_cond_wait() only if the new command is still
NONE. Problem is that ao_command_finished() has to unlock the
audio_output object, and in the meantime, the player thread might have
submitted a new command.
Diffstat (limited to 'src')
-rw-r--r-- | src/output_thread.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/output_thread.c b/src/output_thread.c index da1caef3f..502599cb9 100644 --- a/src/output_thread.c +++ b/src/output_thread.c @@ -455,7 +455,8 @@ static gpointer audio_output_task(gpointer arg) /* the player thread will now clear our music pipe - wait for a notify, to give it some time */ - g_cond_wait(ao->cond, ao->mutex); + if (ao->command == AO_COMMAND_NONE) + g_cond_wait(ao->cond, ao->mutex); continue; case AO_COMMAND_KILL: |