vkswapper: always match lock/unlock of the render lock
authorMatthew Waters <matthew@centricular.com>
Mon, 7 Dec 2015 05:39:53 +0000 (16:39 +1100)
committerMatthew Waters <matthew@centricular.com>
Tue, 16 Feb 2016 14:13:43 +0000 (01:13 +1100)
If a draw event comes from the winsys before we've rendered a buffer we were
deadlocking.

ext/vulkan/vkswapper.c

index 1865ebef67aaac8f95def92a2219baa6ef979bf2..2fd653375d917ec0bf991c048f84ec623ecfdb49 100644 (file)
@@ -1058,8 +1058,10 @@ _on_window_draw (GstVulkanWindow * window, GstVulkanSwapper * swapper)
   GError *error = NULL;
 
   RENDER_LOCK (swapper);
-  if (!swapper->current_buffer)
+  if (!swapper->current_buffer) {
+    RENDER_UNLOCK (swapper);
     return;
+  }
 
   /* TODO: perform some rate limiting of the number of redraw events */
   if (!_render_buffer_unlocked (swapper, swapper->current_buffer, &error))