瀏覽代碼

Merge branch 'master' of https://github.com/raysan5/raylib

Ray 5 年之前
父節點
當前提交
9f699af138
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/raudio.c

+ 6 - 0
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)