From 5d26d67ba7d8ec0565e81d2a22abb7b6ead2fed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 13 Aug 2013 13:06:50 +0200 Subject: [PATCH] sysmem: Only copy the requested part of memory instead of the complete source memory https://bugzilla.gnome.org/show_bug.cgi?id=705678 --- gst/gstallocator.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gst/gstallocator.c b/gst/gstallocator.c index 63b44bcce7..f117d984a5 100644 --- a/gst/gstallocator.c +++ b/gst/gstallocator.c @@ -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; }