fix: Refactor WASAPI initialization error handling to use a more explicit HRESULT value check.

This commit is contained in:
2026-01-24 05:52:07 -05:00
parent d33c421756
commit da1fa27048

View File

@@ -188,8 +188,9 @@ where
F: FnMut(&[f32]),
{
let hr = initialize_mta();
if hr != 0 {
return Err(Error::AudioCapture(format!("WASAPI init failed: HRESULT 0x{:08X}", hr)));
let hr_value: i32 = hr.0;
if hr_value != 0 {
return Err(Error::AudioCapture(format!("WASAPI init failed: HRESULT 0x{:08X}", hr_value)));
}
let result: Result<()> = (|| {