Commit ee75e799 authored by David Reid's avatar David Reid

AAudio: Don't try stopping the stream if it's disconnected.

Public issue https://github.com/mackron/miniaudio/issues/318
parent af1928c3
...@@ -36546,6 +36546,10 @@ static ma_result ma_device_stop_stream__aaudio(ma_device* pDevice, ma_AAudioStre ...@@ -36546,6 +36546,10 @@ static ma_result ma_device_stop_stream__aaudio(ma_device* pDevice, ma_AAudioStre
This maps with miniaudio's requirement that device's be drained which means we don't need to implement any draining logic. This maps with miniaudio's requirement that device's be drained which means we don't need to implement any draining logic.
*/ */
currentState = ((MA_PFN_AAudioStream_getState)pDevice->pContext->aaudio.AAudioStream_getState)(pStream);
if (currentState == MA_AAUDIO_STREAM_STATE_DISCONNECTED) {
return MA_SUCCESS; /* The device is disconnected. Don't try stopping it. */
}
resultAA = ((MA_PFN_AAudioStream_requestStop)pDevice->pContext->aaudio.AAudioStream_requestStop)(pStream); resultAA = ((MA_PFN_AAudioStream_requestStop)pDevice->pContext->aaudio.AAudioStream_requestStop)(pStream);
if (resultAA != MA_AAUDIO_OK) { if (resultAA != MA_AAUDIO_OK) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment