output_thread: unlock the mutex while calling cancel()

The method may take longer, and we shouldn't be holding the lock.
This commit is contained in:
Max Kellermann
2011-07-20 18:35:24 +02:00
parent 8fa51faa38
commit 2b6542467c

View File

@@ -640,8 +640,13 @@ static gpointer audio_output_task(gpointer arg)
case AO_COMMAND_CANCEL: case AO_COMMAND_CANCEL:
ao->chunk = NULL; ao->chunk = NULL;
if (ao->open)
if (ao->open) {
g_mutex_unlock(ao->mutex);
ao_plugin_cancel(ao->plugin, ao->data); ao_plugin_cancel(ao->plugin, ao->data);
g_mutex_lock(ao->mutex);
}
ao_command_finished(ao); ao_command_finished(ao);
/* the player thread will now clear our music /* the player thread will now clear our music