From c3e11f7b7c9aec22f7ecc56feacf42194e7ea727 Mon Sep 17 00:00:00 2001 From: Rostislav Pehlivanov Date: Fri, 29 Jul 2016 02:24:52 +0100 Subject: osdep/io: introduce mp_flush_wakeup_pipe() Makes a fairly common occurence with wakeup_pipes easier to handle. --- video/out/x11_common.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'video') 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) -- cgit v1.2.3