glbasefilter: actually indicate start internally
authorMatthew Waters <matthew@centricular.com>
Mon, 6 Nov 2017 13:07:42 +0000 (00:07 +1100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:30 +0000 (19:32 +0000)
Otherwise when we stop, the necessary stop functions will not be called
and things may be leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=788280

gst-libs/gst/gl/gstglbasefilter.c

index de921cf..3c9eb91 100644 (file)
@@ -280,7 +280,7 @@ gst_gl_base_filter_gl_start (GstGLContext * context, gpointer data)
   gst_gl_insert_debug_marker (filter->context,
       "starting element %s", GST_OBJECT_NAME (filter));
 
-  filter->priv->gl_result = filter_class->gl_start (filter);
+  filter->priv->gl_started = filter_class->gl_start (filter);
 }
 
 static void
@@ -360,14 +360,16 @@ gst_gl_base_filter_decide_allocation (GstBaseTransform * trans,
     gst_gl_context_thread_add (filter->context, gst_gl_base_filter_gl_start,
         filter);
 
-    if (!filter->priv->gl_result)
+    if (!filter->priv->gl_started)
       goto error;
   }
 
-  gst_gl_context_thread_add (filter->context,
-      (GstGLContextThreadFunc) _gl_set_caps, filter);
-  if (!filter->priv->gl_result)
-    goto error;
+  if (filter_class->gl_set_caps) {
+    gst_gl_context_thread_add (filter->context,
+        (GstGLContextThreadFunc) _gl_set_caps, filter);
+    if (!filter->priv->gl_result)
+      goto error;
+  }
 
   return GST_BASE_TRANSFORM_CLASS (parent_class)->decide_allocation (trans,
       query);