glbasememory: Don't change maxsize at run-time

Maxsize is initialized once and should never change. Allocating data
should have no impact on the selected max size for this memory. This
causing memory map failure as the maxsize would become smaller then
size. This happened when using direct rendering in avviddec on GL that
does not support PBO transfer.

https://bugzilla.gnome.org/show_bug.cgi?id=763045
This commit is contained in:
Nicolas Dufresne 2016-03-03 19:45:43 -05:00 committed by Tim-Philipp Müller
parent 9d66a5ff06
commit 910d990e4b

View file

@ -171,7 +171,7 @@ gst_gl_base_memory_init (GstGLBaseMemory * mem, GstAllocator * allocator,
}
static gpointer
_align_data (gpointer data, gsize align, gsize * maxsize)
_align_data (gpointer data, gsize align)
{
guint8 *ret = data;
gsize aoffset;
@ -180,7 +180,6 @@ _align_data (gpointer data, gsize align, gsize * maxsize)
if ((aoffset = ((guintptr) ret & align))) {
aoffset = (align + 1) - aoffset;
ret += aoffset;
*maxsize -= aoffset;
}
return ret;
@ -202,7 +201,7 @@ gst_gl_base_memory_alloc_data (GstGLBaseMemory * gl_mem)
if (gl_mem->alloc_data == NULL)
return FALSE;
gl_mem->data = _align_data (gl_mem->alloc_data, mem->align, &mem->maxsize);
gl_mem->data = _align_data (gl_mem->alloc_data, mem->align);
GST_CAT_DEBUG (GST_CAT_GL_BASE_MEMORY, "%p allocated data pointer alloc %p, "
"data %p", gl_mem, gl_mem->alloc_data, gl_mem->data);