From af1928c3f0a9fc4ac6eac3665ebb0512cb103f5a Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 11 Jan 2022 18:53:14 +1000 Subject: [PATCH] AAudio: Try fixing an issue with automatic stream rerouting. Public issue https://github.com/mackron/miniaudio/issues/318 --- miniaudio.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/miniaudio.h b/miniaudio.h index 4b40756e..1b901fa8 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -1,6 +1,6 @@ /* Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file. -miniaudio - v0.11.4 - 2022-01-12 +miniaudio - v0.11.5 - TBD David Reid - mackron@gmail.com @@ -36625,17 +36625,13 @@ static ma_result ma_device_reinit__aaudio(ma_device* pDevice, ma_device_type dev /* The first thing to do is close the streams. */ if (deviceType == ma_device_type_capture || deviceType == ma_device_type_duplex) { - ma_result result = ma_device_stop_stream__aaudio(pDevice, (ma_AAudioStream*)pDevice->aaudio.pStreamCapture); - if (result != MA_SUCCESS) { - return result; - } + ma_close_stream__aaudio(pDevice->pContext, (ma_AAudioStream*)pDevice->aaudio.pStreamCapture); + pDevice->aaudio.pStreamCapture = NULL; } if (deviceType == ma_device_type_playback || deviceType == ma_device_type_duplex) { - ma_result result = ma_device_stop_stream__aaudio(pDevice, (ma_AAudioStream*)pDevice->aaudio.pStreamPlayback); - if (result != MA_SUCCESS) { - return result; - } + ma_close_stream__aaudio(pDevice->pContext, (ma_AAudioStream*)pDevice->aaudio.pStreamPlayback); + pDevice->aaudio.pStreamPlayback = NULL; } /* Now we need to reinitialize each streams. The hardest part with this is just filling output the config and descriptors. */