Fix COM initialization with MMDevApi

This commit is contained in:
Chris Robinson 2011-05-16 10:31:38 -07:00
parent 507d2f8afb
commit 569106acd3

View File

@ -71,7 +71,9 @@ static void *MMDevApiLoad(void)
if(!Enumerator)
{
void *mme = NULL;
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
if(FAILED(hr))
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if(SUCCEEDED(hr))
{
hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, &mme);