Skip to content

Commit 76b0406

Browse files
authored
Update windows and alsa dependencies (#812)
1 parent efa0c7a commit 76b0406

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ clap = { version = "4.0", features = ["derive"] }
2525
ndk-glue = "0.7"
2626

2727
[target.'cfg(target_os = "windows")'.dependencies]
28-
windows = { version = "0.48.0", features = [
28+
windows = { version = "0.52.0", features = [
2929
"Win32_Media_Audio",
3030
"Win32_Foundation",
3131
"Win32_Devices_Properties",
@@ -34,6 +34,7 @@ windows = { version = "0.48.0", features = [
3434
"Win32_System_Threading",
3535
"Win32_Security",
3636
"Win32_System_SystemServices",
37+
"Win32_System_Variant",
3738
"Win32_Media_Multimedia",
3839
"Win32_UI_Shell_PropertiesSystem"
3940
]}
@@ -43,7 +44,7 @@ parking_lot = "0.12"
4344
once_cell = "1.12"
4445

4546
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"))'.dependencies]
46-
alsa = "0.7"
47+
alsa = "0.8"
4748
libc = "0.2"
4849
parking_lot = "0.12"
4950
jack = { version = "0.11", optional = true }

src/host/wasapi/device.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ use windows::Win32::Foundation;
2525
use windows::Win32::Media::Audio::IAudioRenderClient;
2626
use windows::Win32::Media::{Audio, KernelStreaming, Multimedia};
2727
use windows::Win32::System::Com;
28-
use windows::Win32::System::Com::{StructuredStorage, STGM_READ, VT_LPWSTR};
28+
use windows::Win32::System::Com::{StructuredStorage, STGM_READ};
2929
use windows::Win32::System::Threading;
30+
use windows::Win32::System::Variant::VT_LPWSTR;
3031

3132
use super::stream::{AudioClientFlow, Stream, StreamInner};
3233
use crate::{traits::DeviceTrait, BuildStreamError, StreamError};

src/host/wasapi/stream.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ impl Stream {
149149
fn push_command(&self, command: Command) -> Result<(), SendError<Command>> {
150150
self.commands.send(command)?;
151151
unsafe {
152-
let result = Threading::SetEvent(self.pending_scheduled_event);
153-
assert_ne!(result, false);
152+
Threading::SetEvent(self.pending_scheduled_event).unwrap();
154153
}
155154
Ok(())
156155
}
@@ -162,7 +161,7 @@ impl Drop for Stream {
162161
if self.push_command(Command::Terminate).is_ok() {
163162
self.thread.take().unwrap().join().unwrap();
164163
unsafe {
165-
Foundation::CloseHandle(self.pending_scheduled_event);
164+
let _ = Foundation::CloseHandle(self.pending_scheduled_event);
166165
}
167166
}
168167
}
@@ -185,7 +184,7 @@ impl Drop for StreamInner {
185184
#[inline]
186185
fn drop(&mut self) {
187186
unsafe {
188-
Foundation::CloseHandle(self.event);
187+
let _ = Foundation::CloseHandle(self.event);
189188
}
190189
}
191190
}
@@ -243,8 +242,11 @@ fn wait_for_handle_signal(handles: &[Foundation::HANDLE]) -> Result<usize, Backe
243242
)
244243
};
245244
if result == Foundation::WAIT_FAILED {
246-
let err = unsafe { Foundation::GetLastError() };
247-
let description = format!("`WaitForMultipleObjectsEx failed: {}", err.0);
245+
let err = match unsafe { Foundation::GetLastError() } {
246+
Ok(()) => windows::core::Error::OK,
247+
Err(err) => err,
248+
};
249+
let description = format!("`WaitForMultipleObjectsEx failed: {}", err);
248250
let err = BackendSpecificError { description };
249251
return Err(err);
250252
}

0 commit comments

Comments
 (0)