Update windows-rs dependency (#791)

* Update `windows-rs` dependency

* Fix clippy warnings

* Update CHANGELOG.md
This commit is contained in:
Paul Hansen
2023-07-25 04:35:54 -05:00
committed by GitHub
parent d0ff4fe91f
commit 17d2cc2084
4 changed files with 21 additions and 7 deletions

View File

@@ -1,3 +1,7 @@
# Unreleased
- Update `windows` dependency to v0.48
# Version 0.15.2 (2023-03-30)
- webaudio: support multichannel output streams

View File

@@ -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"

View File

@@ -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<usize, Backe
let result = unsafe {
Threading::WaitForMultipleObjectsEx(
handles,
false, // Don't wait for all, just wait for the first
WindowsProgramming::INFINITE, // TODO: allow setting a timeout
false, // irrelevant parameter here
false, // Don't wait for all, just wait for the first
Threading::INFINITE, // TODO: allow setting a timeout
false, // irrelevant parameter here
)
};
if result == Foundation::WAIT_FAILED {

View File

@@ -457,7 +457,7 @@ impl StreamInstant {
fn from_nanos(nanos: i64) -> 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)]