va: allocator: Fix deadlock caused by double lock

Trivial bug fix for deadlock

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1949>
This commit is contained in:
Seungha Yang 2021-01-12 00:13:22 +09:00
parent 94fea694bc
commit 98eebf3322

View file

@ -1437,11 +1437,11 @@ gst_va_allocator_wait_for_memory (GstAllocator * allocator, GstBuffer * buffer)
GST_VA_MEMORY_POOL_LOCK (&self->pool);
if (!gst_va_memory_pool_wait_unlocked (&self->pool)) {
GST_VA_MEMORY_POOL_LOCK (&self->pool);
GST_VA_MEMORY_POOL_UNLOCK (&self->pool);
return FALSE;
}
surface = gst_va_allocator_prepare_buffer_unlocked (self, buffer);
GST_VA_MEMORY_POOL_LOCK (&self->pool);
GST_VA_MEMORY_POOL_UNLOCK (&self->pool);
if (surface != VA_INVALID_ID) {
GST_TRACE_OBJECT (self, "Prepared surface %#x in buffer %p", surface,