From 140815ff934de45f0476138e30a87a54e3f7f686 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Thu, 3 Mar 2016 19:45:43 -0500 Subject: [PATCH] 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 --- gst-libs/gst/gl/gstglbasememory.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/gl/gstglbasememory.c b/gst-libs/gst/gl/gstglbasememory.c index 88cb8813ee..7300da5bad 100644 --- a/gst-libs/gst/gl/gstglbasememory.c +++ b/gst-libs/gst/gl/gstglbasememory.c @@ -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);