dmime: Don't try to create a standard audio path if the client didn't ask for one.

This commit is contained in:
Andrew Eikum 2012-04-18 10:14:01 -05:00 committed by Alexandre Julliard
parent b09d195bf3
commit 629e857c2e
2 changed files with 17 additions and 2 deletions

View File

@ -945,7 +945,8 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_InitAudio(IDirectMusicPerform
This->pParams.dwFeatures = dwFlags;
This->pParams.clsidDefaultSynth = CLSID_DirectMusicSynthSink;
}
hr = IDirectMusicPerformance8_CreateStandardAudioPath(iface, dwDefaultPathType, dwPChannelCount, FALSE, &This->pDefaultPath);
if(dwDefaultPathType != 0)
hr = IDirectMusicPerformance8_CreateStandardAudioPath(iface, dwDefaultPathType, dwPChannelCount, FALSE, &This->pDefaultPath);
PostMessageToProcessMsgThread(This, PROCESSMSG_START);
@ -1096,7 +1097,7 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_CreateStandardAudioPath(IDire
*ppNewPath = pPath;
TRACE(" returning IDirectMusicPerformance interface at %p.\n", *ppNewPath);
TRACE(" returning IDirectMusicAudioPath interface at %p.\n", *ppNewPath);
return IDirectMusicAudioPath_Activate(*ppNewPath, fActivate);
}

View File

@ -82,6 +82,20 @@ static HRESULT test_InitAudio(void)
IDirectMusicPerformance8_Release(idmusicperformance);
hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL,
CLSCTX_INPROC_SERVER, &IID_IDirectMusicPerformance8,
(void**)&idmusicperformance);
ok(hr == S_OK, "CoCreateInstance failed: %08x\n", hr);
hr = IDirectMusicPerformance8_InitAudio(idmusicperformance, NULL, NULL,
NULL, 0, 64, 0, NULL);
ok(hr == S_OK, "InitAudio failed: %08x\n", hr);
hr = IDirectMusicPerformance8_CloseDown(idmusicperformance);
ok(hr == S_OK, "CloseDown failed: %08x\n", hr);
IDirectMusicPerformance8_Release(idmusicperformance);
return S_OK;
}