Use snd_pcm_avail_update
This commit is contained in:
parent
447ad5d727
commit
a5783d14c5
|
@ -1054,9 +1054,8 @@ fn check_for_pollout_or_pollin(
|
||||||
|
|
||||||
// Determine the number of samples that are available to read/write.
|
// Determine the number of samples that are available to read/write.
|
||||||
fn get_available_samples(stream: &StreamInner) -> Result<usize, BackendSpecificError> {
|
fn get_available_samples(stream: &StreamInner) -> Result<usize, BackendSpecificError> {
|
||||||
// TODO: what about snd_pcm_avail_update?
|
|
||||||
let available = unsafe {
|
let available = unsafe {
|
||||||
alsa::snd_pcm_avail(stream.channel)
|
alsa::snd_pcm_avail_update(stream.channel)
|
||||||
};
|
};
|
||||||
if available == -32 {
|
if available == -32 {
|
||||||
// buffer underrun
|
// buffer underrun
|
||||||
|
|
Loading…
Reference in New Issue