diff options
author | 2016-07-29 02:24:52 +0100 | |
---|---|---|
committer | 2016-07-30 00:02:39 +0200 | |
commit | c3e11f7b7c9aec22f7ecc56feacf42194e7ea727 (patch) | |
tree | c15fd7c3a37794796921d8bfbf709fe00c95901a /audio | |
parent | f3f4e048d8c08d4d578c85dbb32cc80314814d6f (diff) |
osdep/io: introduce mp_flush_wakeup_pipe()
Makes a fairly common occurence with wakeup_pipes easier to handle.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/push.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/audio/out/push.c b/audio/out/push.c index ac87c62a96..bf5dde46b5 100644 --- a/audio/out/push.c +++ b/audio/out/push.c @@ -497,10 +497,8 @@ int ao_wait_poll(struct ao *ao, struct pollfd *fds, int num_fds, bool wakeup = false; if (p_fds[num_fds].revents & POLLIN) { wakeup = true; - // flush the wakeup pipe contents - might "drown" some wakeups, but - // that's ok for our use-case - char buf[100]; - (void)read(p->wakeup_pipe[0], buf, sizeof(buf)); + // might "drown" some wakeups, but that's ok for our use-case + mp_flush_wakeup_pipe(p->wakeup_pipe[0]); } return (r >= 0 || r == -EINTR) ? wakeup : -1; } |