fix: sluggish controls
This commit is contained in:
13
src/mixer.rs
13
src/mixer.rs
@@ -7,6 +7,7 @@ use std::{
|
||||
io::{Read, Write},
|
||||
os::unix::net::{UnixListener, UnixStream},
|
||||
path::Path,
|
||||
process::exit,
|
||||
sync::{
|
||||
mpsc::{channel, Receiver, Sender},
|
||||
Arc, Mutex,
|
||||
@@ -592,6 +593,16 @@ impl Mixer {
|
||||
}
|
||||
|
||||
pub fn iterate_mainloop(mainloop: &mut pulse::mainloop::standard::Mainloop) {
|
||||
mainloop.borrow_mut().iterate(false);
|
||||
match mainloop.borrow_mut().iterate(false) {
|
||||
IterateResult::Success(s) => {
|
||||
if s == 0 {
|
||||
thread::sleep(Duration::from_millis(5));
|
||||
}
|
||||
}
|
||||
IterateResult::Quit(_) => exit(0),
|
||||
IterateResult::Err(e) => {
|
||||
println!("Err: {:?}", e);
|
||||
exit(1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user