Fix failing the assertion when HRESULT is AUDCLNT_S_BUFFER_EMPTY
This commit is contained in:
parent
c2d606176a
commit
8a002b7077
|
@ -5,7 +5,7 @@ use super::winapi::shared::basetsd::UINT32;
|
||||||
use super::winapi::shared::ksmedia;
|
use super::winapi::shared::ksmedia;
|
||||||
use super::winapi::shared::minwindef::{BYTE, DWORD, FALSE, WORD};
|
use super::winapi::shared::minwindef::{BYTE, DWORD, FALSE, WORD};
|
||||||
use super::winapi::shared::mmreg;
|
use super::winapi::shared::mmreg;
|
||||||
use super::winapi::um::audioclient::{self, AUDCLNT_E_DEVICE_INVALIDATED};
|
use super::winapi::um::audioclient::{self, AUDCLNT_E_DEVICE_INVALIDATED, AUDCLNT_S_BUFFER_EMPTY};
|
||||||
use super::winapi::um::audiosessiontypes::{AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_EVENTCALLBACK};
|
use super::winapi::um::audiosessiontypes::{AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_EVENTCALLBACK};
|
||||||
use super::winapi::um::handleapi;
|
use super::winapi::um::handleapi;
|
||||||
use super::winapi::um::synchapi;
|
use super::winapi::um::synchapi;
|
||||||
|
@ -526,6 +526,9 @@ impl EventLoop {
|
||||||
ptr::null_mut(),
|
ptr::null_mut(),
|
||||||
);
|
);
|
||||||
check_result(hresult).unwrap();
|
check_result(hresult).unwrap();
|
||||||
|
|
||||||
|
if hresult == AUDCLNT_S_BUFFER_EMPTY { continue; }
|
||||||
|
|
||||||
debug_assert!(!buffer.is_null());
|
debug_assert!(!buffer.is_null());
|
||||||
let buffer_len = frames_available as usize
|
let buffer_len = frames_available as usize
|
||||||
* stream.bytes_per_frame as usize / sample_size;
|
* stream.bytes_per_frame as usize / sample_size;
|
||||||
|
|
Loading…
Reference in New Issue