glfilter: only warn when other_context attribute is set
authorJulien Isorce <julien.isorce@collabora.co.uk>
Mon, 28 Apr 2014 14:07:34 +0000 (15:07 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:38 +0000 (19:31 +0000)
Fix false positive

gst-libs/gst/gl/gstglfilter.c

index 5d6fc6d..3f90071 100644 (file)
@@ -942,12 +942,15 @@ gst_gl_filter_decide_allocation (GstBaseTransform * trans, GstQuery * query)
     }
   }
 
-  if (!other_context)
-    other_context = filter->other_context;
-  else
-    GST_ELEMENT_WARNING (filter, LIBRARY, SETTINGS,
-        ("%s", "Cannot share with more than one GL context"),
-        ("%s", "Cannot share with more than one GL context"));
+  if (filter->other_context) {
+    if (!other_context) {
+      other_context = filter->other_context;
+    } else {
+      GST_ELEMENT_WARNING (filter, LIBRARY, SETTINGS,
+          ("%s", "Cannot share with more than one GL context"),
+          ("%s", "Cannot share with more than one GL context"));
+    }
+  }
 
   if (!filter->context) {
     filter->context = gst_gl_context_new (filter->display);