diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2018-11-02 17:52:41 +0200 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2018-11-02 17:52:41 +0200 |
commit | 02222c7d066281ff90132816661a6773955b5a49 (patch) | |
tree | 08a5afc839abea6dde6ee8078d82fa77d8bb38c0 | |
parent | 7e701fa7a5d77b3428a21d61d92805cae97a2fa3 (diff) |
Check revents before timing out from pcm_wait
-rw-r--r-- | src/pcm.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; |