0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00

win-wasapi: Unapply/reapply audio monitoring on reconnect

Saves and disable monitoring before entering recover loop, and restores
it after recovery is complete.
This commit is contained in:
Igor Bochkariov 2019-03-12 19:10:24 +04:00 committed by jp9000
parent 041d3b4155
commit 69b4df41c6

View File

@ -1,6 +1,7 @@
#include "enum-wasapi.hpp"
#include <obs-module.h>
#include <obs.h>
#include <util/platform.h>
#include <util/windows/HRError.hpp>
#include <util/windows/ComPtr.hpp>
@ -368,11 +369,16 @@ DWORD WINAPI WASAPISource::ReconnectThread(LPVOID param)
CoInitializeEx(0, COINIT_MULTITHREADED);
obs_monitoring_type type = obs_source_get_monitoring_type(source->source);
obs_source_set_monitoring_type(source->source, OBS_MONITORING_TYPE_NONE);
while (!WaitForSignal(source->stopSignal, RECONNECT_INTERVAL)) {
if (source->TryInitialize())
break;
}
obs_source_set_monitoring_type(source->source, type);
source->reconnectThread = nullptr;
source->reconnecting = false;
return 0;