Skip to content

Leave the graph in a functional state if ring buffer allocation fails#958

Merged
sbooth merged 1 commit into
mainfrom
reconf
Jul 14, 2026
Merged

Leave the graph in a functional state if ring buffer allocation fails#958
sbooth merged 1 commit into
mainfrom
reconf

Conversation

@sbooth

@sbooth sbooth commented Jul 14, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 14, 2026 22:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ensures the audio processing graph remains unchanged and functional when reconfiguring for a new format fails due to ring buffer allocation failure, avoiding leaving AVAudioEngine stopped/disconnected on that error path.

Changes:

  • Allocate a temporary spsc::AudioRingBuffer for the new format before stopping the engine or disconnecting nodes, and return early on allocation failure.
  • Adopt the newly allocated ring buffer via move assignment only after the engine/graph reconfiguration begins.
  • Simplify the reconfiguration restart failure path by removing the TODO and returning failure immediately when the engine can’t restart.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sbooth
sbooth merged commit 2d41692 into main Jul 14, 2026
3 checks passed
@sbooth
sbooth deleted the reconf branch July 14, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants