Update windows-rs dependency (#791)
* Update `windows-rs` dependency * Fix clippy warnings * Update CHANGELOG.md
This commit is contained in:
parent
d0ff4fe91f
commit
17d2cc2084
4 changed files with 21 additions and 7 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
# Unreleased
|
||||||
|
|
||||||
|
- Update `windows` dependency to v0.48
|
||||||
|
|
||||||
# Version 0.15.2 (2023-03-30)
|
# Version 0.15.2 (2023-03-30)
|
||||||
|
|
||||||
- webaudio: support multichannel output streams
|
- webaudio: support multichannel output streams
|
||||||
|
|
|
||||||
13
Cargo.toml
13
Cargo.toml
|
|
@ -25,7 +25,18 @@ clap = { version = "4.0", features = ["derive"] }
|
||||||
ndk-glue = "0.7"
|
ndk-glue = "0.7"
|
||||||
|
|
||||||
[target.'cfg(target_os = "windows")'.dependencies]
|
[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 }
|
asio-sys = { version = "0.2", path = "asio-sys", optional = true }
|
||||||
num-traits = { version = "0.2.6", optional = true }
|
num-traits = { version = "0.2.6", optional = true }
|
||||||
parking_lot = "0.12"
|
parking_lot = "0.12"
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ use windows::Win32::Foundation::WAIT_OBJECT_0;
|
||||||
use windows::Win32::Media::Audio;
|
use windows::Win32::Media::Audio;
|
||||||
use windows::Win32::System::SystemServices;
|
use windows::Win32::System::SystemServices;
|
||||||
use windows::Win32::System::Threading;
|
use windows::Win32::System::Threading;
|
||||||
use windows::Win32::System::WindowsProgramming;
|
|
||||||
|
|
||||||
pub struct Stream {
|
pub struct Stream {
|
||||||
/// The high-priority audio processing thread calling callbacks.
|
/// The high-priority audio processing thread calling callbacks.
|
||||||
|
|
@ -160,7 +159,7 @@ impl Stream {
|
||||||
impl Drop for Stream {
|
impl Drop for Stream {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn drop(&mut self) {
|
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();
|
self.thread.take().unwrap().join().unwrap();
|
||||||
unsafe {
|
unsafe {
|
||||||
Foundation::CloseHandle(self.pending_scheduled_event);
|
Foundation::CloseHandle(self.pending_scheduled_event);
|
||||||
|
|
@ -238,9 +237,9 @@ fn wait_for_handle_signal(handles: &[Foundation::HANDLE]) -> Result<usize, Backe
|
||||||
let result = unsafe {
|
let result = unsafe {
|
||||||
Threading::WaitForMultipleObjectsEx(
|
Threading::WaitForMultipleObjectsEx(
|
||||||
handles,
|
handles,
|
||||||
false, // Don't wait for all, just wait for the first
|
false, // Don't wait for all, just wait for the first
|
||||||
WindowsProgramming::INFINITE, // TODO: allow setting a timeout
|
Threading::INFINITE, // TODO: allow setting a timeout
|
||||||
false, // irrelevant parameter here
|
false, // irrelevant parameter here
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
if result == Foundation::WAIT_FAILED {
|
if result == Foundation::WAIT_FAILED {
|
||||||
|
|
|
||||||
|
|
@ -457,7 +457,7 @@ impl StreamInstant {
|
||||||
fn from_nanos(nanos: i64) -> Self {
|
fn from_nanos(nanos: i64) -> Self {
|
||||||
let secs = nanos / 1_000_000_000;
|
let secs = nanos / 1_000_000_000;
|
||||||
let subsec_nanos = nanos - secs * 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)]
|
#[allow(dead_code)]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue