Commit 5d26d67b authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

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

https://bugzilla.gnome.org/show_bug.cgi?id=705678
parent 104db597
......@@ -458,13 +458,10 @@ _sysmem_copy (GstMemorySystem * mem, gssize offset, gsize size)
if (size == -1)
size = mem->mem.size > offset ? mem->mem.size - offset : 0;
copy =
_sysmem_new_block (0, mem->mem.maxsize, mem->mem.align,
mem->mem.offset + offset, size);
copy = _sysmem_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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment