diff --git a/CHANGELOG.md b/CHANGELOG.md index 532d2c84c..c6ff99ec4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# Unreleased + +- Update `windows` dependency to v0.48 + # Version 0.15.2 (2023-03-30) - webaudio: support multichannel output streams diff --git a/Cargo.toml b/Cargo.toml index 719ae9134..a2298c6ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,18 @@ clap = { version = "4.0", features = ["derive"] } ndk-glue = "0.7" [target.'cfg(target_os = "windows")'.dependencies] -windows = { version = "0.46.0", features = ["Win32_Media_Audio", "Win32_Foundation", "Win32_System_Com", "Win32_Devices_Properties", "Win32_Media_KernelStreaming", "Win32_System_Com_StructuredStorage", "Win32_System_Ole", "Win32_System_Threading", "Win32_Security", "Win32_System_SystemServices", "Win32_System_WindowsProgramming", "Win32_Media_Multimedia", "Win32_UI_Shell_PropertiesSystem"]} +windows = { version = "0.48.0", features = [ + "Win32_Media_Audio", + "Win32_Foundation", + "Win32_Devices_Properties", + "Win32_Media_KernelStreaming", + "Win32_System_Com_StructuredStorage", + "Win32_System_Threading", + "Win32_Security", + "Win32_System_SystemServices", + "Win32_Media_Multimedia", + "Win32_UI_Shell_PropertiesSystem" +]} asio-sys = { version = "0.2", path = "asio-sys", optional = true } num-traits = { version = "0.2.6", optional = true } parking_lot = "0.12" diff --git a/src/host/wasapi/stream.rs b/src/host/wasapi/stream.rs index 5a04695b0..9dcf2e747 100644 --- a/src/host/wasapi/stream.rs +++ b/src/host/wasapi/stream.rs @@ -13,7 +13,6 @@ use windows::Win32::Foundation::WAIT_OBJECT_0; use windows::Win32::Media::Audio; use windows::Win32::System::SystemServices; use windows::Win32::System::Threading; -use windows::Win32::System::WindowsProgramming; pub struct Stream { /// The high-priority audio processing thread calling callbacks. @@ -160,7 +159,7 @@ impl Stream { impl Drop for Stream { #[inline] fn drop(&mut self) { - if let Ok(_) = self.push_command(Command::Terminate) { + if self.push_command(Command::Terminate).is_ok() { self.thread.take().unwrap().join().unwrap(); unsafe { Foundation::CloseHandle(self.pending_scheduled_event); @@ -238,9 +237,9 @@ fn wait_for_handle_signal(handles: &[Foundation::HANDLE]) -> Result Self { let secs = nanos / 1_000_000_000; let subsec_nanos = nanos - secs * 1_000_000_000; - Self::new(secs as i64, subsec_nanos as u32) + Self::new(secs, subsec_nanos as u32) } #[allow(dead_code)]