diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2016-03-03 19:45:43 -0500 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2016-03-03 19:47:26 -0500 |
commit | 140815ff934de45f0476138e30a87a54e3f7f686 (patch) | |
tree | b0e1b4dc2e7a3056b5853051c98fe7b0b3eed886 | |
parent | 7981c1cb8608049ac7e78a6c3cb00b62dd7289e0 (diff) | |
download | gstreamer-plugins-bad-140815ff934de45f0476138e30a87a54e3f7f686.tar.gz |
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
-rw-r--r-- | gst-libs/gst/gl/gstglbasememory.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gst-libs/gst/gl/gstglbasememory.c b/gst-libs/gst/gl/gstglbasememory.c index 88cb8813e..7300da5ba 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); |