From 43eae4f25629a6fb3b330716983545d05a795aee Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 18 Nov 2017 20:09:28 -0500 Subject: [PATCH] Yield immediately on audio driver thread if engine is paused --- src/core/AudioInterface.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/AudioInterface.cpp b/src/core/AudioInterface.cpp index 990f134e..5922b882 100644 --- a/src/core/AudioInterface.cpp +++ b/src/core/AudioInterface.cpp @@ -159,6 +159,11 @@ void AudioInterface::step() { } void AudioInterface::stepStream(const float *input, float *output, int numFrames) { + if (gPaused) { + memset(output, 0, sizeof(float) * numOutputs * numFrames); + return; + } + if (numOutputs > 0) { // Wait for enough input before proceeding while (inputSrcBuffer.size() < numFrames) {