mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
gst: don't dup, use DONT_CLOSE flag on fd_allocator
This commit is contained in:
parent
c2cb8e46b9
commit
aeb77e37f7
1 changed files with 4 additions and 4 deletions
|
|
@ -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);
|
GST_LOG_OBJECT (pool, "wrap buffer %d %d", d->mapoffset, d->maxsize);
|
||||||
if (d->type == SPA_DATA_MemFd) {
|
if (d->type == SPA_DATA_MemFd) {
|
||||||
gmem = gst_fd_allocator_alloc (pool->fd_allocator, dup (d->fd),
|
gmem = gst_fd_allocator_alloc (pool->fd_allocator, d->fd,
|
||||||
d->mapoffset + d->maxsize, GST_FD_MEMORY_FLAG_NONE);
|
d->mapoffset + d->maxsize, GST_FD_MEMORY_FLAG_DONT_CLOSE);
|
||||||
gst_memory_resize (gmem, d->mapoffset, d->maxsize);
|
gst_memory_resize (gmem, d->mapoffset, d->maxsize);
|
||||||
data->offset = d->mapoffset;
|
data->offset = d->mapoffset;
|
||||||
}
|
}
|
||||||
else if(d->type == SPA_DATA_DmaBuf) {
|
else if(d->type == SPA_DATA_DmaBuf) {
|
||||||
gmem = gst_dmabuf_allocator_alloc (pool->dmabuf_allocator, dup (d->fd),
|
gmem = gst_fd_allocator_alloc (pool->dmabuf_allocator, d->fd,
|
||||||
d->mapoffset + d->maxsize);
|
d->mapoffset + d->maxsize, GST_FD_MEMORY_FLAG_DONT_CLOSE);
|
||||||
gst_memory_resize (gmem, d->mapoffset, d->maxsize);
|
gst_memory_resize (gmem, d->mapoffset, d->maxsize);
|
||||||
data->offset = d->mapoffset;
|
data->offset = d->mapoffset;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue