wasapi: Fix paInvalidSampleRate (and any other) error code is replaced with paInvalidDevice if audio client failed to be created due to some reason.

This commit is contained in:
dmitrykos 2020-10-03 23:21:11 +03:00
commit dcc2f7fa48

View file

@ -3705,9 +3705,9 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
stream->in.params.wow64_workaround = paWasapi->useWOW64Workaround; stream->in.params.wow64_workaround = paWasapi->useWOW64Workaround;
// Create and activate audio client // Create and activate audio client
if (FAILED(hr = ActivateAudioClientInput(stream))) if ((result = ActivateAudioClientInput(stream)) != paNoError)
{ {
LogPaError(result = paInvalidDevice); LogPaError(result);
goto error; goto error;
} }
@ -3839,9 +3839,9 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
stream->out.params.wow64_workaround = paWasapi->useWOW64Workaround; stream->out.params.wow64_workaround = paWasapi->useWOW64Workaround;
// Create and activate audio client // Create and activate audio client
if (FAILED(hr = ActivateAudioClientOutput(stream))) if ((result = ActivateAudioClientOutput(stream)) != paNoError)
{ {
LogPaError(result = paInvalidDevice); LogPaError(result);
goto error; goto error;
} }