mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
AAudio: Try fixing an issue with automatic stream rerouting.
Public issue https://github.com/mackron/miniaudio/issues/318
This commit is contained in:
+5
-9
@@ -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.
|
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
|
|||||||
|
|
||||||
/* 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. */
|
||||||
|
|||||||
Reference in New Issue
Block a user