From f7b58f6f6e710db0df02108a59ef45912407bb51 Mon Sep 17 00:00:00 2001 From: jpark37 Date: Sun, 31 Jul 2022 17:29:24 -0700 Subject: [PATCH] win-wasapi: Don't log if reconnect fails --- plugins/win-wasapi/win-wasapi.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/plugins/win-wasapi/win-wasapi.cpp b/plugins/win-wasapi/win-wasapi.cpp index 96f1e147a..08aeca496 100644 --- a/plugins/win-wasapi/win-wasapi.cpp +++ b/plugins/win-wasapi/win-wasapi.cpp @@ -1175,11 +1175,15 @@ DWORD WINAPI WASAPISource::CaptureThread(LPVOID param) _countof(active_sigs); sigs = active_sigs; } else { - blog(LOG_INFO, - "WASAPI: Device '%s' failed to start (source: %s)", - source->device_id.c_str(), - obs_source_get_name( - source->source)); + if (source->reconnectDuration == + 0) { + blog(LOG_INFO, + "WASAPI: Device '%s' failed to start (source: %s)", + source->device_id + .c_str(), + obs_source_get_name( + source->source)); + } stop = true; reconnect = true; source->reconnectDuration = @@ -1280,9 +1284,12 @@ void WASAPISource::OnStartCapture() assert(ret == WAIT_TIMEOUT); if (!TryInitialize()) { - blog(LOG_INFO, - "WASAPI: Device '%s' failed to start (source: %s)", - device_id.c_str(), obs_source_get_name(source)); + if (reconnectDuration == 0) { + blog(LOG_INFO, + "WASAPI: Device '%s' failed to start (source: %s)", + device_id.c_str(), + obs_source_get_name(source)); + } reconnectDuration = RECONNECT_INTERVAL; SetEvent(reconnectSignal); }