mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-29 18:48:44 +00:00
dmabuf: Ensure _get_fd() works even for shared memory
Fixes regression introduced by:
commit b60888fd4b
Author: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Tue May 20 11:18:56 2014 +0200
dmabuf: share the mapping with shared copies of the memory
https://bugzilla.gnome.org/show_bug.cgi?id=730441
This commit is contained in:
parent
a84f10196c
commit
f260baf23b
1 changed files with 2 additions and 2 deletions
|
@ -69,7 +69,7 @@ gst_dmabuf_allocator_free (GstAllocator * allocator, GstMemory * gmem)
|
|||
g_warning (G_STRLOC ":%s: Freeing memory %p still mapped", G_STRFUNC, mem);
|
||||
munmap ((void *) mem->data, gmem->maxsize);
|
||||
}
|
||||
if (mem->fd >= 0)
|
||||
if (mem->fd >= 0 && gmem->parent == NULL)
|
||||
close (mem->fd);
|
||||
g_mutex_clear (&mem->lock);
|
||||
g_slice_free (GstDmaBufMemory, mem);
|
||||
|
@ -176,7 +176,7 @@ gst_dmabuf_mem_share (GstMemory * gmem, gssize offset, gssize size)
|
|||
GST_MINI_OBJECT_FLAG_LOCK_READONLY, mem->mem.allocator, parent,
|
||||
mem->mem.maxsize, mem->mem.align, mem->mem.offset + offset, size);
|
||||
|
||||
sub->fd = -1;
|
||||
sub->fd = mem->fd;
|
||||
g_mutex_init (&sub->lock);
|
||||
|
||||
return GST_MEMORY_CAST (sub);
|
||||
|
|
Loading…
Reference in a new issue