Commit d1742a23 authored by Max Kellermann's avatar Max Kellermann

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.
parent 5555d30b
...@@ -455,7 +455,8 @@ static gpointer audio_output_task(gpointer arg) ...@@ -455,7 +455,8 @@ static gpointer audio_output_task(gpointer arg)
/* the player thread will now clear our music /* the player thread will now clear our music
pipe - wait for a notify, to give it some pipe - wait for a notify, to give it some
time */ time */
g_cond_wait(ao->cond, ao->mutex); if (ao->command == AO_COMMAND_NONE)
g_cond_wait(ao->cond, ao->mutex);
continue; continue;
case AO_COMMAND_KILL: case AO_COMMAND_KILL:
......
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