fix: Refactor WASAPI initialization error handling to use a more explicit HRESULT value check.
This commit is contained in:
@@ -188,8 +188,9 @@ where
|
|||||||
F: FnMut(&[f32]),
|
F: FnMut(&[f32]),
|
||||||
{
|
{
|
||||||
let hr = initialize_mta();
|
let hr = initialize_mta();
|
||||||
if hr != 0 {
|
let hr_value: i32 = hr.0;
|
||||||
return Err(Error::AudioCapture(format!("WASAPI init failed: HRESULT 0x{:08X}", hr)));
|
if hr_value != 0 {
|
||||||
|
return Err(Error::AudioCapture(format!("WASAPI init failed: HRESULT 0x{:08X}", hr_value)));
|
||||||
}
|
}
|
||||||
|
|
||||||
let result: Result<()> = (|| {
|
let result: Result<()> = (|| {
|
||||||
|
|||||||
Reference in New Issue
Block a user