memory: Fix the NO_SHARE flag in the constructor
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 3 Jul 2012 11:47:49 +0000 (13:47 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 5 Jul 2012 09:19:16 +0000 (11:19 +0200)
The NO_SHARE flag does not influence the exclusiveness of the buffer initially
but only if a _share operation can be done. Otherwise, we would not be able to
WRITE map a buffer memory because it would have a share count of at least 2.

gst/gstmemory.c

index 686e1cf..afe68d9 100644 (file)
@@ -153,7 +153,6 @@ _default_mem_init (GstMemoryDefault * mem, GstMemoryFlags flags,
   mem->mem.allocator = _default_mem_impl;
   mem->mem.parent = parent ? gst_memory_ref (parent) : NULL;
   mem->mem.state = (flags & GST_MEMORY_FLAG_READONLY ? GST_LOCK_FLAG_READ : 0);
-  mem->mem.state |= (flags & GST_MEMORY_FLAG_NO_SHARE ? SHARE_ONE : 0);
   mem->mem.maxsize = maxsize;
   mem->mem.align = align;
   mem->mem.offset = offset;