diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2019-05-26 16:36:20 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2019-05-26 16:36:20 +0200 |
commit | eb2cff6058a8f65053e54791a52a5148b8a7cc14 (patch) | |
tree | b857b9dff4d1b3c8798f701d24767cf5def24e34 | |
parent | 8676e30a804b9ebd3374c37df1601d5238293926 (diff) | |
download | gstreamer-plugins-base-eb2cff6058a8f65053e54791a52a5148b8a7cc14.tar.gz |
Revert "gl/wayland: fix glib mainloop integration"
This reverts commit 85c9b7670839801c766a9d1432a5bbc40abcb718.
This caused regressions in master which have not been resolved
yet, so removing backport from 1.14 branch.
See !241 and #603.
Fixes #607
-rw-r--r-- | gst-libs/gst/gl/wayland/wayland_event_source.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/gst-libs/gst/gl/wayland/wayland_event_source.c b/gst-libs/gst/gl/wayland/wayland_event_source.c index 3f9d482ff..12a066805 100644 --- a/gst-libs/gst/gl/wayland/wayland_event_source.c +++ b/gst-libs/gst/gl/wayland/wayland_event_source.c @@ -128,13 +128,19 @@ wayland_event_source_prepare (GSource * base, gint * timeout) wl_display_cancel_read (source->display); if (source->queue) { - if (wl_display_prepare_read_queue (source->display, source->queue) != 0) - return TRUE; + while (wl_display_prepare_read_queue (source->display, source->queue) != 0) { + if (wl_display_dispatch_queue_pending (source->display, + source->queue) < 0) { + g_critical ("Failed to dispatch pending events\n"); + } + } } else { - if (wl_display_prepare_read (source->display) != 0) - return TRUE; + while (wl_display_prepare_read (source->display) != 0) { + if (wl_display_dispatch_pending (source->display) < 0) { + g_critical ("Failed to dispatch pending events\n"); + } + } } - source->reading = TRUE; /* FIXME: this may return EAGAIN if the fd is full */ @@ -148,13 +154,18 @@ static gboolean wayland_event_source_check (GSource * base) { WaylandEventSource *source = (WaylandEventSource *) base; + gboolean retval; - source->reading = FALSE; + retval = source->pfd.revents; - if (wl_display_read_events (source->display) == 0) - return TRUE; + if (source->pfd.revents & G_IO_IN) { + wl_display_read_events (source->display); + } else { + wl_display_cancel_read (source->display); + } + source->reading = FALSE; - return FALSE; + return retval; } static gboolean |