Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat kAudioQueueErr_CannotStart as ephemeral. #1444

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion OSBindings/Mac/Clock Signal/Audio/CSAudioQueue.m
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,15 @@ - (void)enqueueAudioBuffer:(const int16_t *)buffer {
// Starting is a no-op if the queue is already playing, but it may not have been started
// yet, or may have been paused due to a pipeline failure if the producer is running slowly.
if(enqueuedBuffers > 1) {
OSSGuard(^{return AudioQueueStart(self->_audioQueue, NULL);});
OSSGuard(^{
const OSStatus result = AudioQueueStart(self->_audioQueue, NULL);
if(result == kAudioQueueErr_CannotStart) {
// Accept cannot-start, hoping it's ephemeral; Apple's specific advice is:
// "Sleeping briefly and retrying is recommended".
return kAudioSessionNoError;
}
return result;
});
}
[_queueLock unlock];
}
Expand Down
Loading