Commit 54ed994a authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dmsynth: Return DMUS_E_SYNTHNOTCONFIGURED when sink fails to activate.

parent f6deca59
......@@ -425,13 +425,16 @@ static HRESULT WINAPI synth_Activate(IDirectMusicSynth8 *iface, BOOL enable)
if (enable == This->active) return S_FALSE;
if (!This->sink)
return DMUS_E_NOSYNTHSINK;
{
This->active = FALSE;
return enable ? DMUS_E_NOSYNTHSINK : DMUS_E_SYNTHNOTCONFIGURED;
}
if ((hr = IDirectMusicSynthSink_Activate(This->sink, enable)) != S_OK) {
if (hr == DMUS_E_SYNTHACTIVE || hr == S_FALSE)
WARN("Synth and sink active state out of sync. Fixing.\n");
else
return hr;
if (FAILED(hr = IDirectMusicSynthSink_Activate(This->sink, enable))
&& hr != DMUS_E_SYNTHACTIVE)
{
This->active = FALSE;
return DMUS_E_SYNTHNOTCONFIGURED;
}
This->active = enable;
......
......@@ -1016,7 +1016,7 @@ static void test_IDirectMusicSynth(void)
ref = get_refcount(sink);
ok(ref == 2, "got %lu\n", ref);
hr = IDirectMusicSynth_Activate(synth, TRUE);
todo_wine ok(hr == DMUS_E_SYNTHNOTCONFIGURED, "got %#lx\n", hr);
ok(hr == DMUS_E_SYNTHNOTCONFIGURED, "got %#lx\n", hr);
/* SetMasterClock does nothing */
hr = IDirectMusicSynth_SetMasterClock(synth, NULL);
......@@ -1047,9 +1047,9 @@ static void test_IDirectMusicSynth(void)
/* but Activate might fail then */
hr = IDirectMusicSynth_Activate(synth, FALSE);
todo_wine ok(hr == DMUS_E_SYNTHNOTCONFIGURED, "got %#lx\n", hr);
ok(hr == DMUS_E_SYNTHNOTCONFIGURED, "got %#lx\n", hr);
hr = IDirectMusicSynth_Activate(synth, FALSE);
todo_wine ok(hr == S_FALSE, "got %#lx\n", hr);
ok(hr == S_FALSE, "got %#lx\n", hr);
/* Test generating some samples */
......@@ -1064,7 +1064,7 @@ static void test_IDirectMusicSynth(void)
ref = get_refcount(sink);
ok(ref == 2, "got %lu\n", ref);
hr = IDirectMusicSynth_Activate(synth, TRUE);
todo_wine ok(hr == S_OK, "got %#lx\n", hr);
ok(hr == S_OK, "got %#lx\n", hr);
GetTempPathW(MAX_PATH, temp_path);
GetTempFileNameW(temp_path, L"synth", 0, temp_file);
......
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