Commit 83064d15 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dmsynth: Implement the sink Init method.

parent 7bc708df
...@@ -77,6 +77,7 @@ struct IDirectMusicSynthSinkImpl { ...@@ -77,6 +77,7 @@ struct IDirectMusicSynthSinkImpl {
LONG ref; LONG ref;
IReferenceClock *latency_clock; IReferenceClock *latency_clock;
IReferenceClock *master_clock; IReferenceClock *master_clock;
IDirectMusicSynth *synth; /* No reference hold! */
BOOL active; BOOL active;
}; };
......
...@@ -96,7 +96,11 @@ static HRESULT WINAPI IDirectMusicSynthSinkImpl_Init(IDirectMusicSynthSink *ifac ...@@ -96,7 +96,11 @@ static HRESULT WINAPI IDirectMusicSynthSinkImpl_Init(IDirectMusicSynthSink *ifac
{ {
IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface);
FIXME("(%p)->(%p): stub\n", This, synth); TRACE("(%p)->(%p)\n", This, synth);
/* Not holding a reference to avoid circular dependencies.
The synth will release the sink during the synth's destruction. */
This->synth = synth;
return S_OK; return S_OK;
} }
......
...@@ -131,6 +131,8 @@ static void test_dmsynth(void) ...@@ -131,6 +131,8 @@ static void test_dmsynth(void)
ref_clock_sink = get_refcount(clock_sink); ref_clock_sink = get_refcount(clock_sink);
/* This will Init() the SynthSink and finish initializing the Synth */ /* This will Init() the SynthSink and finish initializing the Synth */
hr = IDirectMusicSynthSink_Init(dmsynth_sink2, NULL);
ok(hr == S_OK, "IDirectMusicSynthSink_Init returned: %x\n", hr);
hr = IDirectMusicSynth_SetSynthSink(dmsynth, dmsynth_sink2); hr = IDirectMusicSynth_SetSynthSink(dmsynth, dmsynth_sink2);
ok(hr == S_OK, "IDirectMusicSynth_SetSynthSink returned: %x\n", hr); ok(hr == S_OK, "IDirectMusicSynth_SetSynthSink returned: %x\n", hr);
hr = IDirectMusicSynth_SetSynthSink(dmsynth, dmsynth_sink); hr = IDirectMusicSynth_SetSynthSink(dmsynth, dmsynth_sink);
......
...@@ -195,10 +195,10 @@ static ULONG WINAPI synth_port_Release(IDirectMusicPort *iface) ...@@ -195,10 +195,10 @@ static ULONG WINAPI synth_port_Release(IDirectMusicPort *iface)
if (!ref) if (!ref)
{ {
dmusic_remove_port(This->parent, iface); dmusic_remove_port(This->parent, iface);
IDirectMusicSynthSink_Release(This->synth_sink);
IDirectMusicSynth_Activate(This->synth, FALSE); IDirectMusicSynth_Activate(This->synth, FALSE);
IDirectMusicSynth_Close(This->synth); IDirectMusicSynth_Close(This->synth);
IDirectMusicSynth_Release(This->synth); IDirectMusicSynth_Release(This->synth);
IDirectMusicSynthSink_Release(This->synth_sink);
if (This->dsbuffer) if (This->dsbuffer)
IDirectSoundBuffer_Release(This->dsbuffer); IDirectSoundBuffer_Release(This->dsbuffer);
if (This->dsound) if (This->dsound)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment