dmsynth: Implement the sink Init method.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2022-01-25 00:25:06 +01:00 committed by Alexandre Julliard
parent 7bc708df35
commit 83064d1500
4 changed files with 9 additions and 2 deletions

View File

@ -77,6 +77,7 @@ struct IDirectMusicSynthSinkImpl {
LONG ref;
IReferenceClock *latency_clock;
IReferenceClock *master_clock;
IDirectMusicSynth *synth; /* No reference hold! */
BOOL active;
};

View File

@ -96,7 +96,11 @@ static HRESULT WINAPI IDirectMusicSynthSinkImpl_Init(IDirectMusicSynthSink *ifac
{
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;
}

View File

@ -131,6 +131,8 @@ static void test_dmsynth(void)
ref_clock_sink = get_refcount(clock_sink);
/* 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);
ok(hr == S_OK, "IDirectMusicSynth_SetSynthSink returned: %x\n", hr);
hr = IDirectMusicSynth_SetSynthSink(dmsynth, dmsynth_sink);

View File

@ -195,10 +195,10 @@ static ULONG WINAPI synth_port_Release(IDirectMusicPort *iface)
if (!ref)
{
dmusic_remove_port(This->parent, iface);
IDirectMusicSynthSink_Release(This->synth_sink);
IDirectMusicSynth_Activate(This->synth, FALSE);
IDirectMusicSynth_Close(This->synth);
IDirectMusicSynth_Release(This->synth);
IDirectMusicSynthSink_Release(This->synth_sink);
if (This->dsbuffer)
IDirectSoundBuffer_Release(This->dsbuffer);
if (This->dsound)