synchronize audio pipeline stop with video completion#1316
Merged
richiemcilroy merged 2 commits intomainfrom Oct 29, 2025
Merged
synchronize audio pipeline stop with video completion#1316richiemcilroy merged 2 commits intomainfrom
richiemcilroy merged 2 commits intomainfrom
Conversation
Contributor
WalkthroughAdds a pipeline cancellation token, centralizes actor-spawn error handling with user-facing UI cleanup on failure, removes wall-clock-based silence injection from the audio mixer, and cancels non-video pipelines when screen recording finishes. Changes
Sequence Diagram(s)sequenceDiagram
participant VideoRecorder
participant Watcher
participant AudioPipeline
participant CameraPipeline
participant SystemAudioPipeline
Note over VideoRecorder: Recording in progress
VideoRecorder->>VideoRecorder: Record video
par Parallel pipelines
AudioPipeline->>AudioPipeline: Process audio frames
CameraPipeline->>CameraPipeline: Process camera frames
SystemAudioPipeline->>SystemAudioPipeline: Process system audio
end
rect rgb(220,235,255)
Note over VideoRecorder,Watcher: Video completes
VideoRecorder->>Watcher: screen_done future resolves
Watcher->>AudioPipeline: cancel() -- uses cancel_token
Watcher->>CameraPipeline: cancel() -- uses cancel_token
Watcher->>SystemAudioPipeline: cancel() -- uses cancel_token
end
AudioPipeline->>AudioPipeline: Shutdown
CameraPipeline->>CameraPipeline: Shutdown
SystemAudioPipeline->>SystemAudioPipeline: Shutdown
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cancel audio pipelines (mic, system audio) when video pipeline completes to prevent tracks from outliving video and causing timeline stretching.
Previously, audio tracks continued recording for ~18-19s after video ended, causing the editor timeline to stretch to ~29s while videos were only ~9-9.4s.
Summary by CodeRabbit
Bug Fixes
Improvements