win-wasapi: Ignore timestamp errors

Only log packets with timestamp errors rather than resetting the device.
This commit is contained in:
prgmitchell
2023-11-27 11:06:33 -05:00
committed by Lain
parent 5177a593af
commit 0f498133a4
+6 -5
View File
@@ -181,6 +181,7 @@ class WASAPISource {
const SourceType sourceType;
std::atomic<bool> useDeviceTiming = false;
std::atomic<bool> isDefaultDevice = false;
std::atomic<bool> sawBadTimestamp = false;
bool hooked = false;
bool previouslyFailed = false;
@@ -1092,11 +1093,11 @@ bool WASAPISource::ProcessCaptureData()
return false;
}
if (flags & AUDCLNT_BUFFERFLAGS_TIMESTAMP_ERROR) {
blog(LOG_ERROR, "[WASAPISource::ProcessCaptureData]"
" Timestamp error!");
capture->ReleaseBuffer(frames);
return false;
if (!sawBadTimestamp &&
flags & AUDCLNT_BUFFERFLAGS_TIMESTAMP_ERROR) {
blog(LOG_WARNING, "[WASAPISource::ProcessCaptureData]"
" Timestamp error!");
sawBadTimestamp = true;
}
if (flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY) {