IF_FAILED_INTERNAL_ERROR_JUMP(hr, result, error);\r
\r
paWasapi->devInfo = (PaWasapiDeviceInfo *)PaUtil_AllocateMemory(sizeof(PaWasapiDeviceInfo) * paWasapi->deviceCount);\r
+ if (paWasapi->devInfo == NULL)\r
+ {\r
+ result = paInsufficientMemory;\r
+ goto error;\r
+ }\r
for (i = 0; i < paWasapi->deviceCount; ++i)\r
memset(&paWasapi->devInfo[i], 0, sizeof(PaWasapiDeviceInfo));\r
\r
hr = IAudioClient_GetDevicePeriod(tmpClient,\r
&paWasapi->devInfo[i].DefaultDevicePeriod,\r
&paWasapi->devInfo[i].MinimumDevicePeriod);\r
- // We need to set the result to a value otherwise we will return paNoError\r
- // [IF_FAILED_JUMP(hResult, error);]\r
- IF_FAILED_INTERNAL_ERROR_JUMP(hr, result, error);\r
+ if (FAILED(hr))\r
+ {\r
+ PA_DEBUG(("WASAPI:%d| failed getting min/default periods by IAudioClient::GetDevicePeriod() with error[%d], will use 30000/100000 hns\n", i));\r
+\r
+ // assign WASAPI common values\r
+ paWasapi->devInfo[i].DefaultDevicePeriod = 100000;\r
+ paWasapi->devInfo[i].MinimumDevicePeriod = 30000;\r
+ }\r
\r
//hr = tmpClient->GetMixFormat(&paWasapi->devInfo[i].MixFormat);\r
\r
// We need to set the result to a value otherwise we will return paNoError\r
result = paInternalError;\r
//continue; // do not skip from list, allow to initialize\r
- break;\r
+ break;\r
}\r
\r
(*hostApi)->deviceInfos[i] = deviceInfo;\r