mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 13:06:23 +00:00
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:
parent
7981c1cb86
commit
140815ff93
1 changed files with 2 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue