Merge pull request #105 from mvdnes/alsa_underflow

Fix underflow detection for alsa
This commit is contained in:
tomaka 2016-02-28 17:28:47 +01:00
commit 0ce87de5fc
1 changed files with 2 additions and 2 deletions

View File

@ -317,8 +317,8 @@ impl Voice {
pub fn underflowed(&self) -> bool { pub fn underflowed(&self) -> bool {
let channel = self.channel.lock().expect("channel underflow"); let channel = self.channel.lock().expect("channel underflow");
let state = unsafe { alsa::snd_pcm_state(*channel) }; let available = unsafe { alsa::snd_pcm_avail(*channel) };
state == alsa::SND_PCM_STATE_XRUN available == -32
} }
} }