Commit af1928c3 authored by David Reid's avatar David Reid

AAudio: Try fixing an issue with automatic stream rerouting.

Public issue https://github.com/mackron/miniaudio/issues/318
parent e89650cc
/* /*
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file. 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 David Reid - mackron@gmail.com
...@@ -36625,17 +36625,13 @@ static ma_result ma_device_reinit__aaudio(ma_device* pDevice, ma_device_type dev ...@@ -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. */ /* The first thing to do is close the streams. */
if (deviceType == ma_device_type_capture || deviceType == ma_device_type_duplex) { 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); ma_close_stream__aaudio(pDevice->pContext, (ma_AAudioStream*)pDevice->aaudio.pStreamCapture);
if (result != MA_SUCCESS) { pDevice->aaudio.pStreamCapture = NULL;
return result;
}
} }
if (deviceType == ma_device_type_playback || deviceType == ma_device_type_duplex) { 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); ma_close_stream__aaudio(pDevice->pContext, (ma_AAudioStream*)pDevice->aaudio.pStreamPlayback);
if (result != MA_SUCCESS) { pDevice->aaudio.pStreamPlayback = NULL;
return result;
}
} }
/* Now we need to reinitialize each streams. The hardest part with this is just filling output the config and descriptors. */ /* Now we need to reinitialize each streams. The hardest part with this is just filling output the config and descriptors. */
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