mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-11 13:30:07 -05:00
gst: dequeue a shared buffer instead of original pool buffer
This seems to prevent the pool buffer from getting corrupted. Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
This commit is contained in:
parent
7305d38b85
commit
a1f33a99df
4 changed files with 16 additions and 18 deletions
|
|
@ -92,21 +92,18 @@ void gst_pipewire_pool_wrap_buffer (GstPipeWirePool *pool, struct pw_buffer *b)
|
|||
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_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;
|
||||
}
|
||||
else if (d->type == SPA_DATA_MemPtr) {
|
||||
gmem = gst_memory_new_wrapped (GST_MEMORY_FLAG_NO_SHARE, d->data, d->maxsize, 0,
|
||||
gmem = gst_memory_new_wrapped (0, d->data, d->maxsize, 0,
|
||||
d->maxsize, NULL, NULL);
|
||||
data->offset = 0;
|
||||
}
|
||||
if (gmem)
|
||||
gst_buffer_append_memory (buf, gmem);
|
||||
gst_buffer_insert_memory (buf, i, gmem);
|
||||
}
|
||||
|
||||
data->pool = gst_object_ref (pool);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue