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:
parent
697fcddce5
commit
dcc2f7fa48
1 changed files with 6 additions and 6 deletions
|
|
@ -3705,11 +3705,11 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
|||
stream->in.params.wow64_workaround = paWasapi->useWOW64Workaround;
|
||||
|
||||
// Create and activate audio client
|
||||
if (FAILED(hr = ActivateAudioClientInput(stream)))
|
||||
if ((result = ActivateAudioClientInput(stream)) != paNoError)
|
||||
{
|
||||
LogPaError(result = paInvalidDevice);
|
||||
LogPaError(result);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
// Get closest format
|
||||
hostInputSampleFormat = PaUtil_SelectClosestAvailableFormat(WaveToPaFormat(&stream->in.wavex), inputSampleFormat);
|
||||
|
|
@ -3839,11 +3839,11 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
|||
stream->out.params.wow64_workaround = paWasapi->useWOW64Workaround;
|
||||
|
||||
// Create and activate audio client
|
||||
if (FAILED(hr = ActivateAudioClientOutput(stream)))
|
||||
if ((result = ActivateAudioClientOutput(stream)) != paNoError)
|
||||
{
|
||||
LogPaError(result = paInvalidDevice);
|
||||
LogPaError(result);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
// Get closest format
|
||||
hostOutputSampleFormat = PaUtil_SelectClosestAvailableFormat(WaveToPaFormat(&stream->out.wavex), outputSampleFormat);
|
||||
|
|
|
|||
Loading…
Reference in a new issue