From b905501c55015d9ef14fe47b9a0b9eb8a51eefdd Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Tue, 22 Oct 2019 18:33:18 +0100 Subject: [PATCH] wpe: Get rid of un-necessary frameComplete dispatchs frameComplete() should be called only if there's a new commited frame. --- ext/wpe/WPEThreadedView.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/wpe/WPEThreadedView.cpp b/ext/wpe/WPEThreadedView.cpp index 4d6cafa..1857b44 100644 --- a/ext/wpe/WPEThreadedView.cpp +++ b/ext/wpe/WPEThreadedView.cpp @@ -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; -- 2.7.4