From f8c13d6b6622f0a06331cbb1cf66b3969fa3618c Mon Sep 17 00:00:00 2001 From: Alexander Preisinger Date: Thu, 2 May 2013 23:24:14 +0200 Subject: wayland: fix wrong poll comment, check for errors We only print an error message when POLLERR or POLLHUP occurrs, as the something did go horribly wrong and the server will either deal with it or crash. Also add POLLOUT to the events. --- video/out/wayland_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'video/out/wayland_common.c') diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 654f704df8..054619dc83 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -770,16 +770,18 @@ int vo_wayland_check_events (struct vo *vo) struct pollfd fd = { wl->display->display_fd, - POLLIN | POLLERR | POLLHUP, + POLLIN | POLLOUT | POLLERR | POLLHUP, 0 }; /* wl_display_dispatch is blocking - * wl_dipslay_dispatch is non-blocking but does not read from the fd + * wl_dipslay_dispatch_pending is non-blocking but does not read from the fd * * when pausing no input events get queued so we have to check if there * are events to read from the file descriptor through poll */ if (poll(&fd, 1, 0) > 0) { + if (fd.revents & POLLERR || fd.revents & POLLHUP) + mp_msg(MSGT_VO, MSGL_ERR, "[wayland] error occurred on fd\n"); if (fd.revents & POLLIN) wl_display_dispatch(dp); if (fd.revents & POLLOUT) -- cgit v1.2.3