Update windows and alsa dependencies (#812)

This commit is contained in:
Alphyr 2023-12-04 18:02:15 +01:00 • committed by GitHub
parent efa0c7af6b
commit 76b04065cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 9 deletions

View file

@ -25,8 +25,9 @@ use windows::Win32::Foundation;
use windows::Win32::Media::Audio::IAudioRenderClient;
use windows::Win32::Media::{Audio, KernelStreaming, Multimedia};
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::Variant::VT_LPWSTR;
use super::stream::{AudioClientFlow, Stream, StreamInner};
use crate::{traits::DeviceTrait, BuildStreamError, StreamError};

View file

@ -149,8 +149,7 @@ impl Stream {
fn push_command(&self, command: Command) -> Result<(), SendError<Command>> {
self.commands.send(command)?;
unsafe {
let result = Threading::SetEvent(self.pending_scheduled_event);
assert_ne!(result, false);
Threading::SetEvent(self.pending_scheduled_event).unwrap();
}
Ok(())
}
@ -162,7 +161,7 @@ impl Drop for Stream {
if self.push_command(Command::Terminate).is_ok() {
self.thread.take().unwrap().join().unwrap();
unsafe {
Foundation::CloseHandle(self.pending_scheduled_event);
let _ = Foundation::CloseHandle(self.pending_scheduled_event);
}
}
}
@ -185,7 +184,7 @@ impl Drop for StreamInner {
#[inline]
fn drop(&mut self) {
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 {
let err = unsafe { Foundation::GetLastError() };
let description = format!("`WaitForMultipleObjectsEx failed: {}", err.0);
let err = match unsafe { Foundation::GetLastError() } {
Ok(()) => windows::core::Error::OK,
Err(err) => err,
};
let description = format!("`WaitForMultipleObjectsEx failed: {}", err);
let err = BackendSpecificError { description };
return Err(err);
}