Fix: WASAPI should not fail with error if no device found
This commit is contained in:
parent
00df77e6b1
commit
3532e56784
1 changed files with 3 additions and 3 deletions
|
|
@ -2110,7 +2110,7 @@ static PaError CreateDeviceList(PaWasapiHostApiRepresentation *paWasapi, PaHostA
|
||||||
{
|
{
|
||||||
PaUtilHostApiRepresentation *hostApi = (PaUtilHostApiRepresentation *)paWasapi;
|
PaUtilHostApiRepresentation *hostApi = (PaUtilHostApiRepresentation *)paWasapi;
|
||||||
PaError result = paNoError;
|
PaError result = paNoError;
|
||||||
PaDeviceInfo *deviceInfoArray;
|
PaDeviceInfo *deviceInfoArray = NULL;
|
||||||
UINT32 i;
|
UINT32 i;
|
||||||
WCHAR *defaultRenderId = NULL;
|
WCHAR *defaultRenderId = NULL;
|
||||||
WCHAR *defaultCaptureId = NULL;
|
WCHAR *defaultCaptureId = NULL;
|
||||||
|
|
@ -2228,7 +2228,7 @@ static PaError CreateDeviceList(PaWasapiHostApiRepresentation *paWasapi, PaHostA
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Allocate memory for the device list
|
// Allocate memory for the device list
|
||||||
if ((deviceInfoArray = AllocateDeviceListMemory(paWasapi)) == NULL)
|
if ((paWasapi->deviceCount != 0) && ((deviceInfoArray = AllocateDeviceListMemory(paWasapi)) == NULL))
|
||||||
{
|
{
|
||||||
result = paInsufficientMemory;
|
result = paInsufficientMemory;
|
||||||
goto error;
|
goto error;
|
||||||
|
|
@ -2262,7 +2262,7 @@ static PaError CreateDeviceList(PaWasapiHostApiRepresentation *paWasapi, PaHostA
|
||||||
|
|
||||||
// Fill the remaining slots with inactive device info
|
// Fill the remaining slots with inactive device info
|
||||||
#if defined(PA_WASAPI_MAX_CONST_DEVICE_COUNT) && (PA_WASAPI_MAX_CONST_DEVICE_COUNT > 0)
|
#if defined(PA_WASAPI_MAX_CONST_DEVICE_COUNT) && (PA_WASAPI_MAX_CONST_DEVICE_COUNT > 0)
|
||||||
if (hostApi->info.deviceCount < PA_WASAPI_MAX_CONST_DEVICE_COUNT)
|
if ((hostApi->info.deviceCount != 0) && (hostApi->info.deviceCount < PA_WASAPI_MAX_CONST_DEVICE_COUNT))
|
||||||
{
|
{
|
||||||
for (i = hostApi->info.deviceCount; i < PA_WASAPI_MAX_CONST_DEVICE_COUNT; ++i)
|
for (i = hostApi->info.deviceCount; i < PA_WASAPI_MAX_CONST_DEVICE_COUNT; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue