dmusic: The synth port needs to get the latency clock from the synth.
And not reimplement it. Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ccb216e477
commit
98ecff2760
|
@ -35,7 +35,6 @@ struct synth_port {
|
||||||
IDirectMusic8Impl *parent;
|
IDirectMusic8Impl *parent;
|
||||||
IDirectSound *dsound;
|
IDirectSound *dsound;
|
||||||
IDirectSoundBuffer *dsbuffer;
|
IDirectSoundBuffer *dsbuffer;
|
||||||
IReferenceClock *pLatencyClock;
|
|
||||||
IDirectMusicSynth *synth;
|
IDirectMusicSynth *synth;
|
||||||
IDirectMusicSynthSink *synth_sink;
|
IDirectMusicSynthSink *synth_sink;
|
||||||
BOOL active;
|
BOOL active;
|
||||||
|
@ -200,7 +199,6 @@ static ULONG WINAPI synth_port_Release(IDirectMusicPort *iface)
|
||||||
IDirectMusicSynth_Close(This->synth);
|
IDirectMusicSynth_Close(This->synth);
|
||||||
IDirectMusicSynth_Release(This->synth);
|
IDirectMusicSynth_Release(This->synth);
|
||||||
IDirectMusicSynthSink_Release(This->synth_sink);
|
IDirectMusicSynthSink_Release(This->synth_sink);
|
||||||
IReferenceClock_Release(This->pLatencyClock);
|
|
||||||
if (This->dsbuffer)
|
if (This->dsbuffer)
|
||||||
IDirectSoundBuffer_Release(This->dsbuffer);
|
IDirectSoundBuffer_Release(This->dsbuffer);
|
||||||
if (This->dsound)
|
if (This->dsound)
|
||||||
|
@ -372,10 +370,7 @@ static HRESULT WINAPI synth_port_GetLatencyClock(IDirectMusicPort *iface, IRefer
|
||||||
|
|
||||||
TRACE("(%p/%p)->(%p)\n", iface, This, clock);
|
TRACE("(%p/%p)->(%p)\n", iface, This, clock);
|
||||||
|
|
||||||
*clock = This->pLatencyClock;
|
return IDirectMusicSynth8_GetLatencyClock(This->synth, clock);
|
||||||
IReferenceClock_AddRef(*clock);
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI synth_port_GetRunningStats(IDirectMusicPort *iface, DMUS_SYNTHSTATS *stats)
|
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->params = *port_params;
|
||||||
obj->caps = *port_caps;
|
obj->caps = *port_caps;
|
||||||
|
|
||||||
hr = DMUSIC_CreateReferenceClockImpl(&IID_IReferenceClock, (LPVOID*)&obj->pLatencyClock, NULL);
|
hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth,
|
||||||
if (hr != S_OK)
|
(void **)&obj->synth);
|
||||||
{
|
|
||||||
HeapFree(GetProcessHeap(), 0, obj);
|
|
||||||
return hr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
|
||||||
hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth, (void**)&obj->synth);
|
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynthSink, (void**)&obj->synth_sink);
|
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);
|
IDirectMusicSynth_Release(obj->synth);
|
||||||
if (obj->synth_sink)
|
if (obj->synth_sink)
|
||||||
IDirectMusicSynthSink_Release(obj->synth_sink);
|
IDirectMusicSynthSink_Release(obj->synth_sink);
|
||||||
if (obj->pLatencyClock)
|
|
||||||
IReferenceClock_Release(obj->pLatencyClock);
|
|
||||||
HeapFree(GetProcessHeap(), 0, obj);
|
HeapFree(GetProcessHeap(), 0, obj);
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
|
Loading…
Reference in New Issue