From 6c3d11b8f6af5c6202278560860a8c565162fd51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20W=C4=99grzyn?= Date: Thu, 22 Feb 2024 05:09:56 +0100 Subject: [PATCH] ALSA: don't ignore POLLERR (#731) --- src/host/alsa/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/host/alsa/mod.rs b/src/host/alsa/mod.rs index 137ae2b..bb48322 100644 --- a/src/host/alsa/mod.rs +++ b/src/host/alsa/mod.rs @@ -744,7 +744,12 @@ fn poll_descriptors_and_prepare_buffer( return Ok(PollDescriptorsFlow::Return); } - let stream_type = match stream.channel.revents(&descriptors[1..])? { + let revents = stream.channel.revents(&descriptors[1..])?; + if revents.contains(alsa::poll::Flags::ERR) { + let description = String::from("`alsa::poll()` returned POLLERR"); + return Err(BackendSpecificError { description }); + } + let stream_type = match revents { alsa::poll::Flags::OUT => StreamType::Output, alsa::poll::Flags::IN => StreamType::Input, _ => {