mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
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
This commit is contained in:
parent
aa8ac28d86
commit
52a5658030
1 changed files with 5 additions and 0 deletions
|
@ -680,6 +680,9 @@ gst_v4l2_buffer_pool_resurect_buffer (GstV4l2BufferPool * pool)
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (pool, "A buffer was lost, reallocating it");
|
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 =
|
params.flags =
|
||||||
(GstBufferPoolAcquireFlags) GST_V4L2_BUFFER_POOL_ACQUIRE_FLAG_RESURRECT |
|
(GstBufferPoolAcquireFlags) GST_V4L2_BUFFER_POOL_ACQUIRE_FLAG_RESURRECT |
|
||||||
GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT;
|
GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT;
|
||||||
|
@ -689,6 +692,8 @@ gst_v4l2_buffer_pool_resurect_buffer (GstV4l2BufferPool * pool)
|
||||||
if (ret == GST_FLOW_OK)
|
if (ret == GST_FLOW_OK)
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
|
|
||||||
|
g_signal_handler_unblock (pool->vallocator, pool->group_released_handler);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue