Merge pull request #105 from mvdnes/alsa_underflow
Fix underflow detection for alsa
This commit is contained in:
commit
0ce87de5fc
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue