Update alsa requirement to 0.4.3 and change io to io_bytes

This commit is contained in:
est31 2020-11-08 21:34:20 +01:00
parent 0e0cc39eb4
commit a65e028412
2 changed files with 3 additions and 3 deletions

View file

@ -27,7 +27,7 @@ parking_lot = "0.11"
lazy_static = "1.3" lazy_static = "1.3"
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))'.dependencies] [target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))'.dependencies]
alsa = "0.4.1" alsa = "0.4.3"
nix = "0.15.0" nix = "0.15.0"
libc = "0.2.65" libc = "0.2.65"
jack = { version = "0.6.5", optional = true } jack = { version = "0.6.5", optional = true }

View file

@ -708,7 +708,7 @@ fn process_input(
delay_frames: usize, delay_frames: usize,
data_callback: &mut (dyn FnMut(&Data, &InputCallbackInfo) + Send + 'static), data_callback: &mut (dyn FnMut(&Data, &InputCallbackInfo) + Send + 'static),
) -> Result<(), BackendSpecificError> { ) -> Result<(), BackendSpecificError> {
stream.channel.io().readi(buffer)?; stream.channel.io_bytes().readi(buffer)?;
let sample_format = stream.sample_format; let sample_format = stream.sample_format;
let data = buffer.as_mut_ptr() as *mut (); let data = buffer.as_mut_ptr() as *mut ();
let len = buffer.len() / sample_format.sample_size(); let len = buffer.len() / sample_format.sample_size();
@ -753,7 +753,7 @@ fn process_output(
data_callback(&mut data, &info); data_callback(&mut data, &info);
} }
loop { loop {
match stream.channel.io().writei(buffer) { match stream.channel.io_bytes().writei(buffer) {
Err(err) if err.errno() == Some(nix::errno::Errno::EPIPE) => { Err(err) if err.errno() == Some(nix::errno::Errno::EPIPE) => {
// buffer underrun // buffer underrun
// TODO: Notify the user of this. // TODO: Notify the user of this.