summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/raudio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/raudio.c b/src/raudio.c
index b94f0e65..9fde6e95 100644
--- a/src/raudio.c
+++ b/src/raudio.c
@@ -324,6 +324,12 @@ static void OnSendAudioDataToDevice(ma_device *pDevice, void *pFramesOut, const
framesToRead -= framesJustRead;
framesRead += framesJustRead;
}
+
+ if (!audioBuffer->playing)
+ {
+ framesRead = frameCount;
+ break;
+ }
// If we weren't able to read all the frames we requested, break
if (framesJustRead < framesToReadRightNow)