mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 00:34:03 +02:00
Moved null check to ma_close_stream__aaudio().
This commit is contained in:
+7
-9
@@ -37956,7 +37956,9 @@ static ma_result ma_open_stream__aaudio(ma_device* pDevice, const ma_device_conf
|
|||||||
|
|
||||||
static ma_result ma_close_stream__aaudio(ma_context* pContext, ma_AAudioStream* pStream)
|
static ma_result ma_close_stream__aaudio(ma_context* pContext, ma_AAudioStream* pStream)
|
||||||
{
|
{
|
||||||
MA_ASSERT(pStream != NULL);
|
if (pStream == NULL) {
|
||||||
|
return MA_INVALID_ARGS;
|
||||||
|
}
|
||||||
|
|
||||||
return ma_result_from_aaudio(((MA_PFN_AAudioStream_close)pContext->aaudio.AAudioStream_close)(pStream));
|
return ma_result_from_aaudio(((MA_PFN_AAudioStream_close)pContext->aaudio.AAudioStream_close)(pStream));
|
||||||
}
|
}
|
||||||
@@ -38092,16 +38094,12 @@ static ma_result ma_device_uninit__aaudio(ma_device* pDevice)
|
|||||||
/* When re-routing, streams may have been closed and never re-opened. Hence the extra checks below. */
|
/* When re-routing, streams may have been closed and never re-opened. Hence the extra checks below. */
|
||||||
|
|
||||||
if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) {
|
if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) {
|
||||||
if (pDevice->aaudio.pStreamCapture != NULL) {
|
ma_close_stream__aaudio(pDevice->pContext, (ma_AAudioStream*)pDevice->aaudio.pStreamCapture);
|
||||||
ma_close_stream__aaudio(pDevice->pContext, (ma_AAudioStream*)pDevice->aaudio.pStreamCapture);
|
pDevice->aaudio.pStreamCapture = NULL;
|
||||||
pDevice->aaudio.pStreamCapture = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) {
|
if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) {
|
||||||
if (pDevice->aaudio.pStreamPlayback != NULL) {
|
ma_close_stream__aaudio(pDevice->pContext, (ma_AAudioStream*)pDevice->aaudio.pStreamPlayback);
|
||||||
ma_close_stream__aaudio(pDevice->pContext, (ma_AAudioStream*)pDevice->aaudio.pStreamPlayback);
|
pDevice->aaudio.pStreamPlayback = NULL;
|
||||||
pDevice->aaudio.pStreamPlayback = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return MA_SUCCESS;
|
return MA_SUCCESS;
|
||||||
|
|||||||
Reference in New Issue
Block a user