From 71204f2c3b113a47eba63a600ef36f9e29ced38e Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Fri, 26 Jun 2020 16:43:37 -0400 Subject: [PATCH] v4l2bufferpoool: Fix requeueue after seek when importing When the buffer pool is importing buffer, it will requeue num_allocated on streamon. As this value was not set for DMABuf import and USERPTR, no buffer was queued back. Part-of: --- sys/v4l2/gstv4l2bufferpool.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index 9829bb533d..ef631a4233 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -830,6 +830,7 @@ gst_v4l2_buffer_pool_start (GstBufferPool * bpool) count = gst_v4l2_allocator_start (pool->vallocator, min_buffers, V4L2_MEMORY_USERPTR); + pool->num_allocated = count; /* There is no rational to not get what we asked */ if (count < min_buffers) { @@ -850,6 +851,7 @@ gst_v4l2_buffer_pool_start (GstBufferPool * bpool) count = gst_v4l2_allocator_start (pool->vallocator, min_buffers, V4L2_MEMORY_DMABUF); + pool->num_allocated = count; /* There is no rational to not get what we asked */ if (count < min_buffers) { @@ -891,7 +893,7 @@ gst_v4l2_buffer_pool_start (GstBufferPool * bpool) goto start_failed; if (!V4L2_TYPE_IS_OUTPUT (obj->type)) { - if (g_atomic_int_get (&pool->num_queued) < min_buffers) + if (g_atomic_int_get (&pool->num_queued) < pool->num_allocated) goto queue_failed; pool->group_released_handler =