gluploadelement: also set the context in decide_allocation
authorMatthew Waters <matthew@centricular.com>
Thu, 12 Jul 2018 03:13:04 +0000 (13:13 +1000)
committerMatthew Waters <matthew@centricular.com>
Thu, 12 Jul 2018 03:15:48 +0000 (13:15 +1000)
If downstream doesn't perform allocation queries, the context would
never be set and criticals would occur.

ext/gl/gstgluploadelement.c

index cac11b5..1998c77 100644 (file)
@@ -194,6 +194,12 @@ static gboolean
 _gst_gl_upload_element_decide_allocation (GstBaseTransform * trans,
     GstQuery * query)
 {
+  GstGLUploadElement *upload = GST_GL_UPLOAD_ELEMENT (trans);
+  GstGLContext *context = GST_GL_BASE_FILTER (trans)->context;
+
+  if (upload->upload && context)
+    gst_gl_upload_set_context (upload->upload, context);
+
   return
       GST_BASE_TRANSFORM_CLASS
       (gst_gl_upload_element_parent_class)->decide_allocation (trans, query);