From 1dc0f40a35f8b6fa8299e5e74eb10861e4090c48 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Wed, 27 May 2015 15:44:33 +1000 Subject: [PATCH] gl/wayland: allow a NULL wl_event_queue perform operations on the default wl_display event queue in that case --- gst-libs/gst/gl/wayland/wayland_event_source.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/gl/wayland/wayland_event_source.c b/gst-libs/gst/gl/wayland/wayland_event_source.c index ba853f0659..dd1cf8e8d3 100644 --- a/gst-libs/gst/gl/wayland/wayland_event_source.c +++ b/gst-libs/gst/gl/wayland/wayland_event_source.c @@ -62,9 +62,14 @@ gst_gl_wl_display_roundtrip_queue (struct wl_display *display, if (callback == NULL) return -1; wl_callback_add_listener (callback, &sync_listener, &done); - wl_proxy_set_queue ((struct wl_proxy *) callback, queue); - while (!done && ret >= 0) - ret = wl_display_dispatch_queue (display, queue); + if (queue) { + wl_proxy_set_queue ((struct wl_proxy *) callback, queue); + while (!done && ret >= 0) + ret = wl_display_dispatch_queue (display, queue); + } else { + while (!done && ret >= 0) + ret = wl_display_dispatch (display); + } if (ret == -1 && !done) wl_callback_destroy (callback); @@ -114,7 +119,10 @@ wayland_event_source_dispatch (GSource * base, WaylandEventSource *source = (WaylandEventSource *) base; if (source->pfd.revents) { - wl_display_roundtrip_queue (source->display, source->queue); + if (source->queue) + wl_display_roundtrip_queue (source->display, source->queue); + else + wl_display_roundtrip (source->display); source->pfd.revents = 0; }