Browse Source

win-wasapi: Fix audio capture after unplugging device

This commit fixes a bug where the user would have to restart OBS when
certain types of devices are unplugged and plugged back in again
(particularly USB devices).  A wait interval is required
(RECONNECT_INTERVAL) because Windows does not send any events to
IAudioCaptureClient on device invalidation.
Igor Bochkariov 6 years ago
parent
commit
041d3b4155
1 changed files with 1 additions and 1 deletions
  1. 1 1
      plugins/win-wasapi/win-wasapi.cpp

+ 1 - 1
plugins/win-wasapi/win-wasapi.cpp

@@ -448,7 +448,7 @@ DWORD WINAPI WASAPISource::CaptureThread(LPVOID param)
 	bool         reconnect = false;
 
 	/* Output devices don't signal, so just make it check every 10 ms */
-	DWORD        dur       = source->isInputDevice ? INFINITE : 10;
+	DWORD        dur       = source->isInputDevice ? RECONNECT_INTERVAL : 10;
 
 	HANDLE sigs[2] = {
 		source->receiveSignal,