summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2018-04-13 09:28:53 +0200
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2018-04-18 14:39:09 +0200
commit1dc3c9e183669c2b23ab0428109a6e107ace6e25 (patch)
treed2e09413b9dd567adf030c92aa517533b7a765a3
parent8d87648c21cf9e5227dcdd7e71baea03b5d3d99e (diff)
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
-rw-r--r--gst-libs/gst/vaapi/gstvaapiwindow_wayland.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c b/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c
index 3d77e456..bd2d89d8 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;