qt: always update the sink_retrieved flag when the sink retrieves
authorMatthew Waters <matthew@centricular.com>
Thu, 12 Aug 2021 12:57:01 +0000 (22:57 +1000)
committerMatthew Waters <matthew@centricular.com>
Thu, 12 Aug 2021 12:57:01 +0000 (22:57 +1000)
Fixes a case where adding a qmlgloverlay element after an existing
qmlglsink elements was already in the pipeline would create an entirely
separate GstGLDisplay pointing to the same underlying display resource.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1050>

ext/qt/gstqtglutility.cc

index 6d413bc..b38e16f 100644 (file)
@@ -85,11 +85,11 @@ gst_qt_get_gl_display (gboolean sink)
       GST_INFO ("returning previously created display");
       G_UNLOCK (display_lock);
       return display;
-    } else if (sink) {
-      sink_retrieved = sink;
     }
     gst_clear_object (&display);
   }
+  if (sink)
+    sink_retrieved = sink;
 
   GST_INFO ("QGuiApplication::instance()->platformName() %s", app->platformName().toUtf8().data());