diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2015-03-02 12:04:00 +0100 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2015-03-02 15:26:58 -0500 |
commit | fe3cdccbf2922053fe3774875e315d5ed9a66a72 (patch) | |
tree | 2cc4970d3c3f3ff3d1831497475f8a707e3bccae | |
parent | 54cae21e0e15e871ceec6e7fcdc502727cafaf76 (diff) |
v4l2allocator: fix fd leak in DMABUF import mode.
Ensure gst_v4l2_buffer_pool_release_buffer() releases the associated
GstV4l2MemoryGroup. In particular, this allows for closing the DMABUF
handles prior to instantiating new ones.
https://bugzilla.gnome.org/show_bug.cgi?id=745443
-rw-r--r-- | sys/v4l2/gstv4l2bufferpool.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index 865de4b39..ed6a25ce7 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -1271,7 +1271,9 @@ gst_v4l2_buffer_pool_release_buffer (GstBufferPool * bpool, GstBuffer * buffer) case GST_V4L2_IO_USERPTR: case GST_V4L2_IO_DMABUF_IMPORT: { - if (gst_v4l2_is_buffer_valid (buffer, NULL)) { + GstV4l2MemoryGroup *group; + if (gst_v4l2_is_buffer_valid (buffer, &group)) { + gst_v4l2_allocator_reset_group (pool->vallocator, group); /* queue back in the device */ if (pool->other_pool) gst_v4l2_buffer_pool_prepare_buffer (pool, buffer, NULL); |