mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 08:17:01 +00:00
sysmem: Only copy the requested part of memory instead of the complete source memory
https://bugzilla.gnome.org/show_bug.cgi?id=705678
This commit is contained in:
parent
104db59706
commit
5d26d67ba7
1 changed files with 3 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue