wpe: Get rid of un-necessary frameComplete dispatchs

frameComplete() should be called only if there's a new commited frame.
This commit is contained in:
Philippe Normand 2019-10-22 18:33:18 +01:00
parent 0f03e33b03
commit b905501c55

View 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;