Ignore play/pause errors for ALSA Stream

This commit is contained in:
Alex Moon 2020-04-12 13:11:35 -04:00
parent 62d540d396
commit b386e63eec
2 changed files with 9 additions and 6 deletions

View file

@ -49,13 +49,15 @@ impl Iterator for Devices {
// See if the device has an available output stream.
let has_available_output = {
let playback_handle = alsa::pcm::PCM::new(&name, alsa::Direction::Playback, true);
let playback_handle =
alsa::pcm::PCM::new(&name, alsa::Direction::Playback, true);
playback_handle.is_ok()
};
// See if the device has an available input stream.
let has_available_input = {
let capture_handle = alsa::pcm::PCM::new(&name, alsa::Direction::Capture, true);
let capture_handle =
alsa::pcm::PCM::new(&name, alsa::Direction::Capture, true);
capture_handle.is_ok()
};