Update windows and alsa dependencies (#812)

This commit is contained in:
Alphyr 2023-12-04 18:02:15 +01:00 • committed by GitHub
parent efa0c7af6b
commit 76b04065cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 9 deletions

View file

@ -25,7 +25,7 @@ clap = { version = "4.0", features = ["derive"] }
ndk-glue = "0.7"
[target.'cfg(target_os = "windows")'.dependencies]
windows = { version = "0.48.0", features = [
windows = { version = "0.52.0", features = [
"Win32_Media_Audio",
"Win32_Foundation",
"Win32_Devices_Properties",
@ -34,6 +34,7 @@ windows = { version = "0.48.0", features = [
"Win32_System_Threading",
"Win32_Security",
"Win32_System_SystemServices",
"Win32_System_Variant",
"Win32_Media_Multimedia",
"Win32_UI_Shell_PropertiesSystem"
]}
@ -43,7 +44,7 @@ parking_lot = "0.12"
once_cell = "1.12"
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"))'.dependencies]
alsa = "0.7"
alsa = "0.8"
libc = "0.2"
parking_lot = "0.12"
jack = { version = "0.11", optional = true }

View file

@ -25,8 +25,9 @@ use windows::Win32::Foundation;
use windows::Win32::Media::Audio::IAudioRenderClient;
use windows::Win32::Media::{Audio, KernelStreaming, Multimedia};
use windows::Win32::System::Com;
use windows::Win32::System::Com::{StructuredStorage, STGM_READ, VT_LPWSTR};
use windows::Win32::System::Com::{StructuredStorage, STGM_READ};
use windows::Win32::System::Threading;
use windows::Win32::System::Variant::VT_LPWSTR;
use super::stream::{AudioClientFlow, Stream, StreamInner};
use crate::{traits::DeviceTrait, BuildStreamError, StreamError};

View file

@ -149,8 +149,7 @@ impl Stream {
fn push_command(&self, command: Command) -> Result<(), SendError<Command>> {
self.commands.send(command)?;
unsafe {
let result = Threading::SetEvent(self.pending_scheduled_event);
assert_ne!(result, false);
Threading::SetEvent(self.pending_scheduled_event).unwrap();
}
Ok(())
}
@ -162,7 +161,7 @@ impl Drop for Stream {
if self.push_command(Command::Terminate).is_ok() {
self.thread.take().unwrap().join().unwrap();
unsafe {
Foundation::CloseHandle(self.pending_scheduled_event);
let _ = Foundation::CloseHandle(self.pending_scheduled_event);
}
}
}
@ -185,7 +184,7 @@ impl Drop for StreamInner {
#[inline]
fn drop(&mut self) {
unsafe {
Foundation::CloseHandle(self.event);
let _ = Foundation::CloseHandle(self.event);
}
}
}
@ -243,8 +242,11 @@ fn wait_for_handle_signal(handles: &[Foundation::HANDLE]) -> Result<usize, Backe
)
};
if result == Foundation::WAIT_FAILED {
let err = unsafe { Foundation::GetLastError() };
let description = format!("`WaitForMultipleObjectsEx failed: {}", err.0);
let err = match unsafe { Foundation::GetLastError() } {
Ok(()) => windows::core::Error::OK,
Err(err) => err,
};
let description = format!("`WaitForMultipleObjectsEx failed: {}", err);
let err = BackendSpecificError { description };
return Err(err);
}