Browse Source

win-wasapi: Call CoInitializeEx in reconnect thread

Fixes an issue where COM might not be available to calls within the
reconnect thread.
Igor Bochkariov 6 years ago
parent
commit
abe59f7187
1 changed files with 2 additions and 0 deletions
  1. 2 0
      plugins/win-wasapi/win-wasapi.cpp

+ 2 - 0
plugins/win-wasapi/win-wasapi.cpp

@@ -366,6 +366,8 @@ DWORD WINAPI WASAPISource::ReconnectThread(LPVOID param)
 
 	os_set_thread_name("win-wasapi: reconnect thread");
 
+	CoInitializeEx(0, COINIT_MULTITHREADED);
+
 	while (!WaitForSignal(source->stopSignal, RECONNECT_INTERVAL)) {
 		if (source->TryInitialize())
 			break;