Update windows and alsa dependencies (#812)
This commit is contained in:
parent
efa0c7af6b
commit
76b04065cf
3 changed files with 13 additions and 9 deletions
|
|
@ -25,7 +25,7 @@ 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.48.0", features = [
|
windows = { version = "0.52.0", features = [
|
||||||
"Win32_Media_Audio",
|
"Win32_Media_Audio",
|
||||||
"Win32_Foundation",
|
"Win32_Foundation",
|
||||||
"Win32_Devices_Properties",
|
"Win32_Devices_Properties",
|
||||||
|
|
@ -34,6 +34,7 @@ windows = { version = "0.48.0", features = [
|
||||||
"Win32_System_Threading",
|
"Win32_System_Threading",
|
||||||
"Win32_Security",
|
"Win32_Security",
|
||||||
"Win32_System_SystemServices",
|
"Win32_System_SystemServices",
|
||||||
|
"Win32_System_Variant",
|
||||||
"Win32_Media_Multimedia",
|
"Win32_Media_Multimedia",
|
||||||
"Win32_UI_Shell_PropertiesSystem"
|
"Win32_UI_Shell_PropertiesSystem"
|
||||||
]}
|
]}
|
||||||
|
|
@ -43,7 +44,7 @@ parking_lot = "0.12"
|
||||||
once_cell = "1.12"
|
once_cell = "1.12"
|
||||||
|
|
||||||
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"))'.dependencies]
|
[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"
|
libc = "0.2"
|
||||||
parking_lot = "0.12"
|
parking_lot = "0.12"
|
||||||
jack = { version = "0.11", optional = true }
|
jack = { version = "0.11", optional = true }
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,9 @@ use windows::Win32::Foundation;
|
||||||
use windows::Win32::Media::Audio::IAudioRenderClient;
|
use windows::Win32::Media::Audio::IAudioRenderClient;
|
||||||
use windows::Win32::Media::{Audio, KernelStreaming, Multimedia};
|
use windows::Win32::Media::{Audio, KernelStreaming, Multimedia};
|
||||||
use windows::Win32::System::Com;
|
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::Threading;
|
||||||
|
use windows::Win32::System::Variant::VT_LPWSTR;
|
||||||
|
|
||||||
use super::stream::{AudioClientFlow, Stream, StreamInner};
|
use super::stream::{AudioClientFlow, Stream, StreamInner};
|
||||||
use crate::{traits::DeviceTrait, BuildStreamError, StreamError};
|
use crate::{traits::DeviceTrait, BuildStreamError, StreamError};
|
||||||
|
|
|
||||||
|
|
@ -149,8 +149,7 @@ impl Stream {
|
||||||
fn push_command(&self, command: Command) -> Result<(), SendError<Command>> {
|
fn push_command(&self, command: Command) -> Result<(), SendError<Command>> {
|
||||||
self.commands.send(command)?;
|
self.commands.send(command)?;
|
||||||
unsafe {
|
unsafe {
|
||||||
let result = Threading::SetEvent(self.pending_scheduled_event);
|
Threading::SetEvent(self.pending_scheduled_event).unwrap();
|
||||||
assert_ne!(result, false);
|
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
@ -162,7 +161,7 @@ impl Drop for Stream {
|
||||||
if self.push_command(Command::Terminate).is_ok() {
|
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);
|
let _ = Foundation::CloseHandle(self.pending_scheduled_event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -185,7 +184,7 @@ impl Drop for StreamInner {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
unsafe {
|
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 {
|
if result == Foundation::WAIT_FAILED {
|
||||||
let err = unsafe { Foundation::GetLastError() };
|
let err = match unsafe { Foundation::GetLastError() } {
|
||||||
let description = format!("`WaitForMultipleObjectsEx failed: {}", err.0);
|
Ok(()) => windows::core::Error::OK,
|
||||||
|
Err(err) => err,
|
||||||
|
};
|
||||||
|
let description = format!("`WaitForMultipleObjectsEx failed: {}", err);
|
||||||
let err = BackendSpecificError { description };
|
let err = BackendSpecificError { description };
|
||||||
return Err(err);
|
return Err(err);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue