wpe: Get rid of un-necessary frameComplete dispatchs
authorPhilippe Normand <philn@igalia.com>
Tue, 22 Oct 2019 17:33:18 +0000 (18:33 +0100)
committerPhilippe Normand <philn@igalia.com>
Thu, 24 Oct 2019 09:41:10 +0000 (09:41 +0000)
frameComplete() should be called only if there's a new commited frame.

ext/wpe/WPEThreadedView.cpp

index 4d6cafa..1857b44 100644 (file)
@@ -270,6 +270,7 @@ bool WPEThreadedView::initialize(GstWpeSrc* src, GstGLContext* context, GstGLDis
 GstEGLImage* WPEThreadedView::image()
 {
     GstEGLImage* ret = nullptr;
+    bool dispatchFrameComplete = false;
 
     {
         GMutexHolder lock(images.mutex);
@@ -286,13 +287,14 @@ GstEGLImage* WPEThreadedView::image()
 
             if (previousImage)
                 gst_egl_image_unref(previousImage);
+            dispatchFrameComplete = true;
         }
 
         if (images.committed)
             ret = images.committed;
     }
 
-    if (ret)
+    if (dispatchFrameComplete)
         frameComplete();
 
     return ret;