mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 18:20:44 +00:00
gl/wayland: fix wayland event source burning CPU
Commit c71dd72b
"gl/wayland: fix glib mainloop integration" was overeager
in removing the poll result test from the check function. This caused
dispatch to be called even if no new events are available on the
Wayland connection, which in turn would wake up the glib mainloop,
causing effectively a tight loop without ever blocking on the poll.
Fixes #603
This commit is contained in:
parent
d8d4904e71
commit
7b8fc744f1
1 changed files with 6 additions and 2 deletions
|
@ -151,8 +151,12 @@ wayland_event_source_check (GSource * base)
|
||||||
|
|
||||||
source->reading = FALSE;
|
source->reading = FALSE;
|
||||||
|
|
||||||
|
if (source->pfd.revents & G_IO_IN) {
|
||||||
if (wl_display_read_events (source->display) == 0)
|
if (wl_display_read_events (source->display) == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
} else {
|
||||||
|
wl_display_cancel_read (source->display);
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue