aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-07-20 18:35:24 +0200
committerMax Kellermann <max@duempel.org>2011-07-20 19:05:08 +0200
commit2b6542467c5b14be21e2319bac3b88f42696ddcb (patch)
treed5e1369293ce31479923c9060963eb845385938e
parent8fa51faa389426f1edd285e20c3ddbdf4aebce71 (diff)
downloadmpd-2b6542467c5b14be21e2319bac3b88f42696ddcb.tar.gz
mpd-2b6542467c5b14be21e2319bac3b88f42696ddcb.tar.xz
mpd-2b6542467c5b14be21e2319bac3b88f42696ddcb.zip
output_thread: unlock the mutex while calling cancel()
The method may take longer, and we shouldn't be holding the lock.
-rw-r--r--src/output_thread.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/output_thread.c b/src/output_thread.c
index 4e0446791..2c2b8d116 100644
--- a/src/output_thread.c
+++ b/src/output_thread.c
@@ -640,8 +640,13 @@ static gpointer audio_output_task(gpointer arg)
case AO_COMMAND_CANCEL:
ao->chunk = NULL;
- if (ao->open)
+
+ if (ao->open) {
+ g_mutex_unlock(ao->mutex);
ao_plugin_cancel(ao->plugin, ao->data);
+ g_mutex_lock(ao->mutex);
+ }
+
ao_command_finished(ao);
/* the player thread will now clear our music