CoreAudio fix
This commit is contained in:
parent
fdc7d05be0
commit
31ce5d1732
|
@ -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, ×tamp);
|
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;
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue