pulsesink: Fix deadlock if connecting to PA fails
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Fri, 11 Mar 2011 17:36:31 +0000 (23:06 +0530)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Fri, 11 Mar 2011 17:49:34 +0000 (23:19 +0530)
Commit dd4ec22e introduced a deadlock in the failure path while trying
to connect to PulseAudio. This makes sure we drop the lock on the
resource mutex to avoid this.

https://bugzilla.gnome.org/show_bug.cgi?id=644510

ext/pulse/pulsesink.c

index 6ddc490..110adde 100644 (file)
@@ -527,6 +527,7 @@ gst_pulseringbuffer_open_device (GstRingBuffer * buf)
   /* ERRORS */
 unlock_and_fail:
   {
+    g_mutex_unlock (pa_shared_resource_mutex);
     gst_pulsering_destroy_context (pbuf);
     pa_threaded_mainloop_unlock (mainloop);
     return FALSE;