summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2016-07-19 03:00:03 +0100
committerwm4 <wm4@nowhere>2016-07-19 10:01:51 +0200
commite11a20a8122b370b66235284dd4f67ce1f1bbc0b (patch)
treeb907ad1d4483d5006c41acbde01d1510f4fa56fd /video/out
parent64cd0f429236be1f0420665f50d39d1bfa021e17 (diff)
downloadmpv-e11a20a8122b370b66235284dd4f67ce1f1bbc0b.tar.bz2
mpv-e11a20a8122b370b66235284dd4f67ce1f1bbc0b.tar.xz
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.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/wayland_common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 0e44dddef6..6861c93fca 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -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;