allocator: make a copy with the same alignment

When making a copy of the memory allocated from the default memory allocator,
make sure the new copy has the same alignment as the original memory.

See https://bugzilla.gnome.org/show_bug.cgi?id=680796
This commit is contained in:
Wim Taymans 2012-08-20 11:31:51 +02:00
parent b94e46b8b4
commit 0e4d2814fd

View file

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