sysmem: Only copy the requested part of memory instead of the complete source memory

https://bugzilla.gnome.org/show_bug.cgi?id=705678

Conflicts:
	gst/gstallocator.c
This commit is contained in:
Sebastian Dröge 2013-08-13 13:06:50 +02:00 committed by Tim-Philipp Müller
parent 16b2a6a234
commit b9cf399fbe

View file

@ -453,13 +453,11 @@ _default_mem_copy (GstMemoryDefault * mem, gssize offset, gsize size)
if (size == -1)
size = mem->mem.size > offset ? mem->mem.size - offset : 0;
copy =
_default_mem_new_block (0, mem->mem.maxsize, mem->mem.align,
mem->mem.offset + offset, size);
copy = _default_mem_new_block (0, size, mem->mem.align, 0, size);
GST_CAT_DEBUG (GST_CAT_PERFORMANCE,
"memcpy %" G_GSIZE_FORMAT " memory %p -> %p", mem->mem.maxsize, mem,
copy);
memcpy (copy->data, mem->data, mem->mem.maxsize);
"memcpy %" G_GSIZE_FORMAT " memory %p -> %p", size, mem, copy);
memcpy (copy->data, mem->data + mem->mem.offset + offset, size);
return copy;
}