Michael Stefaniuc : dmusic: The synth port needs to get the latency clock from the synth.
Alexandre Julliard
julliard at winehq.org
Fri Jan 21 15:54:49 CST 2022
Module: wine
Branch: master
Commit: 98ecff2760c4c79eeee6dd824e070138475c5912
URL: https://source.winehq.org/git/wine.git/?a=commit;h=98ecff2760c4c79eeee6dd824e070138475c5912
Author: Michael Stefaniuc <mstefani at winehq.org>
Date: Fri Jan 21 18:41:09 2022 +0100
dmusic: The synth port needs to get the latency clock from the synth.
And not reimplement it.
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/dmusic/port.c | 20 +++-----------------
1 file changed, 3 insertions(+), 17 deletions(-)
diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c
index fb807e7871a..31b3b764e02 100644
--- a/dlls/dmusic/port.c
+++ b/dlls/dmusic/port.c
@@ -35,7 +35,6 @@ struct synth_port {
IDirectMusic8Impl *parent;
IDirectSound *dsound;
IDirectSoundBuffer *dsbuffer;
- IReferenceClock *pLatencyClock;
IDirectMusicSynth *synth;
IDirectMusicSynthSink *synth_sink;
BOOL active;
@@ -200,7 +199,6 @@ static ULONG WINAPI synth_port_Release(IDirectMusicPort *iface)
IDirectMusicSynth_Close(This->synth);
IDirectMusicSynth_Release(This->synth);
IDirectMusicSynthSink_Release(This->synth_sink);
- IReferenceClock_Release(This->pLatencyClock);
if (This->dsbuffer)
IDirectSoundBuffer_Release(This->dsbuffer);
if (This->dsound)
@@ -372,10 +370,7 @@ static HRESULT WINAPI synth_port_GetLatencyClock(IDirectMusicPort *iface, IRefer
TRACE("(%p/%p)->(%p)\n", iface, This, clock);
- *clock = This->pLatencyClock;
- IReferenceClock_AddRef(*clock);
-
- return S_OK;
+ return IDirectMusicSynth8_GetLatencyClock(This->synth, clock);
}
static HRESULT WINAPI synth_port_GetRunningStats(IDirectMusicPort *iface, DMUS_SYNTHSTATS *stats)
@@ -840,15 +835,8 @@ HRESULT synth_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_param
obj->params = *port_params;
obj->caps = *port_caps;
- hr = DMUSIC_CreateReferenceClockImpl(&IID_IReferenceClock, (LPVOID*)&obj->pLatencyClock, NULL);
- if (hr != S_OK)
- {
- HeapFree(GetProcessHeap(), 0, obj);
- return hr;
- }
-
- if (SUCCEEDED(hr))
- hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth, (void**)&obj->synth);
+ hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth,
+ (void **)&obj->synth);
if (SUCCEEDED(hr))
hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynthSink, (void**)&obj->synth_sink);
@@ -898,8 +886,6 @@ HRESULT synth_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_param
IDirectMusicSynth_Release(obj->synth);
if (obj->synth_sink)
IDirectMusicSynthSink_Release(obj->synth_sink);
- if (obj->pLatencyClock)
- IReferenceClock_Release(obj->pLatencyClock);
HeapFree(GetProcessHeap(), 0, obj);
return hr;
More information about the wine-cvs
mailing list