ALSA: don't ignore POLLERR (#731)

This commit is contained in:
Przemysław Węgrzyn 2024-02-22 05:09:56 +01:00 • committed by GitHub
parent adaa49de8b
commit 6c3d11b8f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,
_ => {