From 50b09dcf11b2939a5702104b6726d10ad44df43b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 25 Sep 2023 19:10:17 +0200 Subject: [PATCH] dmime: Set the port direct sound before activating it. --- dlls/dmime/performance.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index d8624427423..e2d070b0fbe 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -651,10 +651,14 @@ static HRESULT perf_dmport_create(struct performance *perf, DMUS_PORTPARAMS *par if (FAILED(hr = IDirectMusic8_CreatePort(perf->dmusic, &guid, params, &port, NULL))) return hr; - if (FAILED(hr = IDirectMusicPort_Activate(port, TRUE))) { + + if (FAILED(hr = IDirectMusicPort_SetDirectSound(port, perf->dsound, NULL)) + || FAILED(hr = IDirectMusicPort_Activate(port, TRUE))) + { IDirectMusicPort_Release(port); return hr; } + for (i = 0; i < params->dwChannelGroups; i++) pchannel_block_set(&perf->pchannels, i, port, i + 1, FALSE);