From 74ea3f8381d99b9fcb70210b7d3472fff7d3a94a Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 16 Oct 2016 08:20:14 +1000 Subject: [PATCH] ALSA: Don't ask the client for more data when the device is closing. --- mini_al.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mini_al.h b/mini_al.h index 7cdf8f34..5349d063 100644 --- a/mini_al.h +++ b/mini_al.h @@ -1602,6 +1602,11 @@ mal_bool32 mal_device_write__alsa(mal_device* pDevice) if (framesAvailable == 0) { return MAL_FALSE; } + + // Don't bother asking the client for more audio data if we're just stopping the device anyway. + if (pDevice->alsa.breakFromMainLoop) { + return MAL_FALSE; + } mal_device__read_samples_from_client(pDevice, framesAvailable * pDevice->channels, pBuffer);