summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMatt Fischer <matt.fischer@garmin.com>2017-06-28 14:05:27 -0500
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2017-06-29 15:54:42 -0400
commit52a565803032a68e778ce8c2e1a953909db4e2bd (patch)
treed5ca4bb21e83a0e4b4ee4e8da84aeafceae8a911 /sys
parentaa8ac28d86a5c45314a6d62cfd579842f8aecad2 (diff)
v4l2: Block recursive calls to resurect_buffer
When resurrecting a buffer, the subsequent free call can result in the group-released handler being called again, which causes a recursive loop. This patch blocks the signal handler during the time that it executes, ensuring that the loop will not occur. https://bugzilla.gnome.org/show_bug.cgi?id=759292
Diffstat (limited to 'sys')
-rw-r--r--sys/v4l2/gstv4l2bufferpool.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c
index 5a58dc2e3..16abfccc1 100644
--- a/sys/v4l2/gstv4l2bufferpool.c
+++ b/sys/v4l2/gstv4l2bufferpool.c
@@ -680,6 +680,9 @@ gst_v4l2_buffer_pool_resurect_buffer (GstV4l2BufferPool * pool)
GST_DEBUG_OBJECT (pool, "A buffer was lost, reallocating it");
+ /* block recursive calls to this function */
+ g_signal_handler_block (pool->vallocator, pool->group_released_handler);
+
params.flags =
(GstBufferPoolAcquireFlags) GST_V4L2_BUFFER_POOL_ACQUIRE_FLAG_RESURRECT |
GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT;
@@ -689,6 +692,8 @@ gst_v4l2_buffer_pool_resurect_buffer (GstV4l2BufferPool * pool)
if (ret == GST_FLOW_OK)
gst_buffer_unref (buffer);
+ g_signal_handler_unblock (pool->vallocator, pool->group_released_handler);
+
return ret;
}