vo_wayland: fix high CPU usage due to busy polling

There's no need to call wl_display_flush() since all the client-side
buffered data has already been flushed prior to polling the fd.
Instead only check for POLLIN and the usual ERR+HUP.
This commit is contained in:
Rostislav Pehlivanov 2016-07-19 03:00:03 +01:00 committed by wm4
parent 64cd0f4292
commit e11a20a812
1 changed files with 3 additions and 3 deletions

View File

@ -1106,7 +1106,7 @@ static int vo_wayland_poll (struct vo *vo, int timeout_msecs)
struct pollfd fd = {
wl->display.display_fd,
POLLIN | POLLOUT | POLLERR | POLLHUP,
POLLIN | POLLERR | POLLHUP,
0
};
@ -1125,8 +1125,8 @@ static int vo_wayland_poll (struct vo *vo, int timeout_msecs)
}
if (fd.revents & POLLIN)
wl_display_dispatch(dp);
if (fd.revents & POLLOUT)
wl_display_flush(dp);
else
wl_display_dispatch_pending(dp);
}
return polled;