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:
parent
041d3b4155
commit
69b4df41c6
@ -1,6 +1,7 @@
|
|||||||
#include "enum-wasapi.hpp"
|
#include "enum-wasapi.hpp"
|
||||||
|
|
||||||
#include <obs-module.h>
|
#include <obs-module.h>
|
||||||
|
#include <obs.h>
|
||||||
#include <util/platform.h>
|
#include <util/platform.h>
|
||||||
#include <util/windows/HRError.hpp>
|
#include <util/windows/HRError.hpp>
|
||||||
#include <util/windows/ComPtr.hpp>
|
#include <util/windows/ComPtr.hpp>
|
||||||
@ -368,11 +369,16 @@ DWORD WINAPI WASAPISource::ReconnectThread(LPVOID param)
|
|||||||
|
|
||||||
CoInitializeEx(0, COINIT_MULTITHREADED);
|
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)) {
|
while (!WaitForSignal(source->stopSignal, RECONNECT_INTERVAL)) {
|
||||||
if (source->TryInitialize())
|
if (source->TryInitialize())
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
obs_source_set_monitoring_type(source->source, type);
|
||||||
|
|
||||||
source->reconnectThread = nullptr;
|
source->reconnectThread = nullptr;
|
||||||
source->reconnecting = false;
|
source->reconnecting = false;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user