From bd29bb0bad4815bbca324f6e21f2ee0cb632ae63 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 15 Nov 2018 20:05:38 +1000 Subject: [PATCH] Stop spamming the callback on the null backend. --- mini_al.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mini_al.h b/mini_al.h index 52de8f12..9f32bb92 100644 --- a/mini_al.h +++ b/mini_al.h @@ -4917,11 +4917,11 @@ mal_uint32 mal_device__wait_for_frames__null(mal_device* pDevice) while (!pDevice->null_device.breakFromMainLoop) { mal_uint32 framesAvailable = mal_device__get_available_frames__null(pDevice); - if (framesAvailable > 0) { + if (framesAvailable >= (pDevice->bufferSizeInFrames/pDevice->periods)) { return framesAvailable; } - mal_sleep(16); + mal_sleep(pDevice->bufferSizeInMilliseconds/pDevice->periods); } // We'll get here if the loop was terminated. Just return whatever's available.