diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/alsa/NonBlock.cxx | 7 | ||||
-rw-r--r-- | src/lib/alsa/NonBlock.hxx | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/alsa/NonBlock.cxx b/src/lib/alsa/NonBlock.cxx index 3f4a4adc0..7bc1b225b 100644 --- a/src/lib/alsa/NonBlock.cxx +++ b/src/lib/alsa/NonBlock.cxx @@ -50,7 +50,7 @@ AlsaNonBlockPcm::PrepareSockets(MultiSocketMonitor &m, snd_pcm_t *pcm) void AlsaNonBlockPcm::DispatchSockets(MultiSocketMonitor &m, - snd_pcm_t *pcm) noexcept + snd_pcm_t *pcm) { int count = snd_pcm_poll_descriptors_count(pcm); if (count <= 0) @@ -69,7 +69,10 @@ AlsaNonBlockPcm::DispatchSockets(MultiSocketMonitor &m, }); unsigned short dummy; - snd_pcm_poll_descriptors_revents(pcm, pfds, i - pfds, &dummy); + int err = snd_pcm_poll_descriptors_revents(pcm, pfds, i - pfds, &dummy); + if (err < 0) + throw FormatRuntimeError("snd_pcm_poll_descriptors_revents() failed: %s", + snd_strerror(-err)); } std::chrono::steady_clock::duration diff --git a/src/lib/alsa/NonBlock.hxx b/src/lib/alsa/NonBlock.hxx index 6b9f8f940..0242c0f8a 100644 --- a/src/lib/alsa/NonBlock.hxx +++ b/src/lib/alsa/NonBlock.hxx @@ -45,8 +45,10 @@ public: /** * Wrapper for snd_pcm_poll_descriptors_revents(), to be * called from MultiSocketMonitor::DispatchSockets(). + * + * Throws on error. */ - void DispatchSockets(MultiSocketMonitor &m, snd_pcm_t *pcm) noexcept; + void DispatchSockets(MultiSocketMonitor &m, snd_pcm_t *pcm); }; /** |