CoreAudio fix

This commit is contained in:
Andy Vandijck 2025-05-22 15:26:51 +02:00
parent fdc7d05be0
commit 31ce5d1732
1 changed files with 3 additions and 3 deletions

View File

@ -458,7 +458,7 @@ void CoreAudioAudio::setBuffer(uint16_t* finalWave, int length) {
this_buf->mAudioDataByteSize += (UInt32)length; this_buf->mAudioDataByteSize += (UInt32)length;
if (this_buf->mAudioDataByteSize == this_buf->mAudioDataBytesCapacity) { if (this_buf->mAudioDataByteSize == this_buf->mAudioDataBytesCapacity) {
status = AudioQueueCreateTimeline(mQueue, &timeLine); status = AudioQueueCreateTimeline(audioQueue, &timeline);
if(status == noErr) { if(status == noErr) {
AudioQueueGetCurrentTime(audioQueue, timeline, &starttime, NULL); AudioQueueGetCurrentTime(audioQueue, timeline, &starttime, NULL);
AudioQueueEnqueueBufferWithParameters(audioQueue, this_buf, 0, NULL, 0, 0, 0, NULL, &starttime, &timestamp); AudioQueueEnqueueBufferWithParameters(audioQueue, this_buf, 0, NULL, 0, 0, 0, NULL, &starttime, &timestamp);
@ -491,7 +491,7 @@ void CoreAudioAudio::write(uint16_t* finalWave, int length) {
current_buffer = 0; current_buffer = 0;
} }
while (filled_buffers >= OPTION(kSoundBuffers)) { while (filled_buffers >= (OPTION(kSoundBuffers) - 1)) {
wxMilliSleep(1); wxMilliSleep(1);
} }
} }
@ -507,7 +507,7 @@ void CoreAudioAudio::write(uint16_t* finalWave, int length) {
current_buffer = 0; current_buffer = 0;
} }
while (filled_buffers >= OPTION(kSoundBuffers)) { while (filled_buffers >= (OPTION(kSoundBuffers) - 1)) {
wxMilliSleep(1); wxMilliSleep(1);
} }
} }