mirror of
https://github.com/mackron/miniaudio.git
synced 2026-07-22 12:52:43 +02:00
Core Audio: Fix a deadlock when audio processing fails.
Public issue https://github.com/mackron/miniaudio/issues/1136
This commit is contained in:
+3
-1
@@ -39746,6 +39746,7 @@ static OSStatus ma_on_input__coreaudio(void* pUserData, AudioUnitRenderActionFla
|
|||||||
*/
|
*/
|
||||||
result = ma_device_realloc_AudioBufferList__coreaudio(pDevice, frameCount, pDevice->capture.internalFormat, pDevice->capture.internalChannels, layout);
|
result = ma_device_realloc_AudioBufferList__coreaudio(pDevice, frameCount, pDevice->capture.internalFormat, pDevice->capture.internalChannels, layout);
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
|
ma_device_state_async_release(&pDeviceStateCoreAudio->async);
|
||||||
ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, "Failed to allocate AudioBufferList for capture.");
|
ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, "Failed to allocate AudioBufferList for capture.");
|
||||||
return noErr;
|
return noErr;
|
||||||
}
|
}
|
||||||
@@ -39768,6 +39769,7 @@ static OSStatus ma_on_input__coreaudio(void* pUserData, AudioUnitRenderActionFla
|
|||||||
|
|
||||||
status = pContextStateCoreAudio->AudioUnitRender(pDeviceStateCoreAudio->audioUnitCapture, pActionFlags, pTimeStamp, busNumber, frameCount, pRenderedBufferList);
|
status = pContextStateCoreAudio->AudioUnitRender(pDeviceStateCoreAudio->audioUnitCapture, pActionFlags, pTimeStamp, busNumber, frameCount, pRenderedBufferList);
|
||||||
if (status != noErr) {
|
if (status != noErr) {
|
||||||
|
ma_device_state_async_release(&pDeviceStateCoreAudio->async);
|
||||||
ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, "ERROR: AudioUnitRender() failed with %d.", (int)status);
|
ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, "ERROR: AudioUnitRender() failed with %d.", (int)status);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@@ -52677,7 +52679,7 @@ MA_API void ma_device_state_async_process(ma_device_state_async* pAsyncDeviceSta
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ma_semaphore_release(&pAsyncDeviceState->semaphore);
|
ma_device_state_async_release(pAsyncDeviceState);
|
||||||
}
|
}
|
||||||
/* END ma_device_state_async.c */
|
/* END ma_device_state_async.c */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user