summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2016-07-29 02:24:52 +0100
committerwm4 <wm4@nowhere>2016-07-30 00:02:39 +0200
commitc3e11f7b7c9aec22f7ecc56feacf42194e7ea727 (patch)
treec15fd7c3a37794796921d8bfbf709fe00c95901a /video
parentf3f4e048d8c08d4d578c85dbb32cc80314814d6f (diff)
downloadmpv-c3e11f7b7c9aec22f7ecc56feacf42194e7ea727.tar.bz2
mpv-c3e11f7b7c9aec22f7ecc56feacf42194e7ea727.tar.xz
osdep/io: introduce mp_flush_wakeup_pipe()
Makes a fairly common occurence with wakeup_pipes easier to handle.
Diffstat (limited to 'video')
-rw-r--r--video/out/x11_common.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index ee19e1be73..a9d6a2a632 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1934,10 +1934,8 @@ void vo_x11_wait_events(struct vo *vo, int64_t until_time_us)
poll(fds, 2, timeout_ms);
- if (fds[1].revents & POLLIN) {
- char buf[100];
- (void)read(x11->wakeup_pipe[0], buf, sizeof(buf)); // flush
- }
+ if (fds[1].revents & POLLIN)
+ mp_flush_wakeup_pipe(x11->wakeup_pipe[0]);
}
static void xscreensaver_heartbeat(struct vo_x11_state *x11)