From 31ce5d1732a2d6c3b7addcf6f2f2130d32173f4d Mon Sep 17 00:00:00 2001 From: Andy Vandijck Date: Thu, 22 May 2025 15:26:51 +0200 Subject: [PATCH] CoreAudio fix --- src/wx/audio/internal/coreaudio.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wx/audio/internal/coreaudio.cpp b/src/wx/audio/internal/coreaudio.cpp index e84ebadc..a03d7d32 100644 --- a/src/wx/audio/internal/coreaudio.cpp +++ b/src/wx/audio/internal/coreaudio.cpp @@ -458,7 +458,7 @@ void CoreAudioAudio::setBuffer(uint16_t* finalWave, int length) { this_buf->mAudioDataByteSize += (UInt32)length; if (this_buf->mAudioDataByteSize == this_buf->mAudioDataBytesCapacity) { - status = AudioQueueCreateTimeline(mQueue, &timeLine); + status = AudioQueueCreateTimeline(audioQueue, &timeline); if(status == noErr) { AudioQueueGetCurrentTime(audioQueue, timeline, &starttime, NULL); AudioQueueEnqueueBufferWithParameters(audioQueue, this_buf, 0, NULL, 0, 0, 0, NULL, &starttime, ×tamp); @@ -491,7 +491,7 @@ void CoreAudioAudio::write(uint16_t* finalWave, int length) { current_buffer = 0; } - while (filled_buffers >= OPTION(kSoundBuffers)) { + while (filled_buffers >= (OPTION(kSoundBuffers) - 1)) { wxMilliSleep(1); } } @@ -507,7 +507,7 @@ void CoreAudioAudio::write(uint16_t* finalWave, int length) { current_buffer = 0; } - while (filled_buffers >= OPTION(kSoundBuffers)) { + while (filled_buffers >= (OPTION(kSoundBuffers) - 1)) { wxMilliSleep(1); } }