summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2018-11-02 17:52:41 +0200
committerJari Vetoniemi <mailroxas@gmail.com>2018-11-02 17:52:41 +0200
commit02222c7d066281ff90132816661a6773955b5a49 (patch)
tree08a5afc839abea6dde6ee8078d82fa77d8bb38c0
parent7e701fa7a5d77b3428a21d61d92805cae97a2fa3 (diff)
Check revents before timing out from pcm_wait
-rw-r--r--src/pcm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pcm.c b/src/pcm.c
index 2ca8f8a..fd647ca 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -476,6 +476,9 @@ snd_pcm_wait(snd_pcm_t *pcm, int timeout)
goto nodata; // timeout
}
+ if (sio_revents(pcm->hdl, pfd) & want)
+ break;
+
if (timeout > 0) {
const uint64_t delta = ((get_time_ns() - start) / 1e6);
if ((uint64_t)timeout <= delta)
@@ -483,9 +486,6 @@ snd_pcm_wait(snd_pcm_t *pcm, int timeout)
timeout -= delta;
}
-
- if (sio_revents(pcm->hdl, pfd) & want)
- break;
}
return 1;