[PATCH 0/1] MR5647: xaudio2/tests: Fix test failures with xaudio2_8 in test_submix().
From: Paul Gofman <pgofman(a)codeweavers.com> --- dlls/xaudio2_7/tests/xaudio2.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/dlls/xaudio2_7/tests/xaudio2.c b/dlls/xaudio2_7/tests/xaudio2.c index 62f766a827a..a1de2959441 100644 --- a/dlls/xaudio2_7/tests/xaudio2.c +++ b/dlls/xaudio2_7/tests/xaudio2.c @@ -859,10 +859,18 @@ static void test_submix(IXAudio2 *xa) hr = IXAudio2_CreateSubmixVoice(xa, &sub2, 2, 44100, 0, 0, NULL, NULL); ok(hr == S_OK, "CreateSubmixVoice failed: %08lx\n", hr); - send_desc.pOutputVoice = (IXAudio2Voice *)sub2; hr = IXAudio2SubmixVoice_SetOutputVoices(sub, &sends); - ok(hr == S_OK, "CreateSubmixVoice failed: %08lx\n", hr); + ok(hr == S_OK || (XAUDIO2_VER >= 8 && hr == XAUDIO2_E_INVALID_CALL), "CreateSubmixVoice failed: %08lx\n", hr); + if (hr == XAUDIO2_E_INVALID_CALL) + { + IXAudio2SubmixVoice_DestroyVoice(sub2); + hr = IXAudio2_CreateSubmixVoice(xa, &sub2, 2, 44100, 0, 1, NULL, NULL); + ok(hr == S_OK, "CreateSubmixVoice failed: %08lx\n", hr); + send_desc.pOutputVoice = (IXAudio2Voice *)sub2; + hr = IXAudio2SubmixVoice_SetOutputVoices(sub, &sends); + ok(hr == S_OK, "CreateSubmixVoice failed: %08lx\n", hr); + } IXAudio2SubmixVoice_DestroyVoice(sub2); /* The voice is not destroyed. */ @@ -873,7 +881,13 @@ static void test_submix(IXAudio2 *xa) sends.SendCount = 0; hr = IXAudio2SubmixVoice_SetOutputVoices(sub, &sends); - ok(hr == S_OK, "CreateSubmixVoice failed: %08lx\n", hr); + ok(hr == S_OK || (XAUDIO2_VER >= 8 && hr == XAUDIO2_E_INVALID_CALL), "SetOutputVoices failed: %08lx\n", hr); + if (hr == XAUDIO2_E_INVALID_CALL) + { + sends.pSends = NULL; + hr = IXAudio2SubmixVoice_SetOutputVoices(sub, &sends); + ok(hr == S_OK, "SetOutputVoices failed: %08lx\n", hr); + } IXAudio2SubmixVoice_DestroyVoice(sub2); if (0) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5647
xaudio2_8 tests started failing on Windows since commit b928f0eb08da9a10dae3cb7b33ec16b164a2fddd ("xaudio2: Use FAudioVoice_DestroyVoiceSafeEXT() in destroy_voice()."). Apparently xaudio 2.8 has improved validation: - IXAudio2SubmixVoice_SetOutputVoices() fails if the output voice doesn't have ProcessingStage greater than source voice; - IXAudio2SubmixVoice_SetOutputVoices() fails if pSendList have zero SendCount in XAUDIO2_VOICE_SENDS but non-NULL pSends. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5647#note_70417
This merge request was approved by Huw Davies. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5647
participants (3)
-
Huw Davies (@huw) -
Paul Gofman -
Paul Gofman (@gofman)