From aeb77e37f78dd8c4d6e7caaec03aff26db1646da Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 31 Oct 2018 09:36:19 +0000 Subject: [PATCH] gst: don't dup, use DONT_CLOSE flag on fd_allocator --- src/gst/gstpipewirepool.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gst/gstpipewirepool.c b/src/gst/gstpipewirepool.c index 22270bbb0..51d48cdb5 100644 --- a/src/gst/gstpipewirepool.c +++ b/src/gst/gstpipewirepool.c @@ -84,14 +84,14 @@ void gst_pipewire_pool_wrap_buffer (GstPipeWirePool *pool, struct pw_buffer *b) GST_LOG_OBJECT (pool, "wrap buffer %d %d", d->mapoffset, d->maxsize); if (d->type == SPA_DATA_MemFd) { - gmem = gst_fd_allocator_alloc (pool->fd_allocator, dup (d->fd), - d->mapoffset + d->maxsize, GST_FD_MEMORY_FLAG_NONE); + gmem = gst_fd_allocator_alloc (pool->fd_allocator, d->fd, + d->mapoffset + d->maxsize, GST_FD_MEMORY_FLAG_DONT_CLOSE); gst_memory_resize (gmem, d->mapoffset, d->maxsize); data->offset = d->mapoffset; } else if(d->type == SPA_DATA_DmaBuf) { - gmem = gst_dmabuf_allocator_alloc (pool->dmabuf_allocator, dup (d->fd), - d->mapoffset + d->maxsize); + gmem = gst_fd_allocator_alloc (pool->dmabuf_allocator, d->fd, + d->mapoffset + d->maxsize, GST_FD_MEMORY_FLAG_DONT_CLOSE); gst_memory_resize (gmem, d->mapoffset, d->maxsize); data->offset = d->mapoffset; }