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

Public issue https://github.com/mackron/miniaudio/issues/318
This commit is contained in:
David Reid
2022-01-11 18:58:49 +10:00
parent af1928c3f0
commit ee75e79975
+4
View File
@@ -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) {