mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 16:54:03 +02:00
Experimental fix for an hang when stopping devices.
Public issue https://github.com/mackron/miniaudio/issues/355
This commit is contained in:
+15
@@ -12673,6 +12673,11 @@ static ma_result ma_device_audio_thread__default_read_write(ma_device* pDevice)
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure we don't get stuck in the inner loop. */
|
||||
if (capturedDeviceFramesProcessed == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
totalCapturedDeviceFramesProcessed += capturedDeviceFramesProcessed;
|
||||
}
|
||||
} break;
|
||||
@@ -12696,6 +12701,11 @@ static ma_result ma_device_audio_thread__default_read_write(ma_device* pDevice)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Make sure we don't get stuck in the inner loop. */
|
||||
if (framesProcessed == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
ma_device__send_frames_to_client(pDevice, framesProcessed, capturedDeviceData);
|
||||
|
||||
framesReadThisPeriod += framesProcessed;
|
||||
@@ -12723,6 +12733,11 @@ static ma_result ma_device_audio_thread__default_read_write(ma_device* pDevice)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Make sure we don't get stuck in the inner loop. */
|
||||
if (framesProcessed == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
framesWrittenThisPeriod += framesProcessed;
|
||||
}
|
||||
} break;
|
||||
|
||||
Reference in New Issue
Block a user