From: Michael Olbrich Date: Fri, 13 Apr 2018 07:28:53 +0000 (+0200) Subject: wayland: don't poll if there are no pending frames X-Git-Tag: 1.19.3~503^2~721 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f71b5a57d4dff4cb6ad21d6a55eef77ed6a3dbe;p=platform%2Fupstream%2Fgstreamer.git wayland: don't poll if there are no pending frames Otherwise the following poll may not return for an arbitrary amount of time. This can happen if another wayland event queue has flushed and read our events. https://bugzilla.gnome.org/show_bug.cgi?id=795224 --- diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c b/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c index 3d77e45..bd2d89d 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c @@ -185,6 +185,11 @@ gst_vaapi_window_wayland_sync (GstVaapiWindow * window) if (wl_display_flush (wl_display) < 0) goto error; + if (g_atomic_int_get (&priv->num_frames_pending) == 0) { + wl_display_cancel_read (wl_display); + return TRUE; + } + again: if (gst_poll_wait (priv->poll, GST_CLOCK_TIME_NONE) < 0) { int saved_errno = errno;