-
Notifications
You must be signed in to change notification settings - Fork 910
don't abort encoding if capurer stop fails #1223
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
Conversation
WalkthroughShifts video source lifecycle management into a new "capture-video" task that starts and later stops the video source; the muxing path no longer starts or stops the video source and runs until cancellation, relying on the capture task to handle start/stop and log stop errors. Changes
Sequence Diagram(s)sequenceDiagram
participant Capture as Capture Task
participant Source as Video Source
participant Muxer as Muxing Path
participant Cancel as Cancellation
rect rgb(235, 245, 255)
Note over Capture,Source: New capture task lifecycle
Capture->>Source: start()
Capture->>Cancel: await cancellation
Cancel-->>Capture: cancel
Capture->>Source: stop()
Source-->>Capture: ok / error (logged)
end
rect rgb(245, 255, 235)
Note over Muxer: Muxing path behavior
Muxer->>Muxer: process frames until cancellation
Cancel-->>Muxer: cancel
Muxer-->>Muxer: terminate without stopping Source
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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). (3)
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
crates/recording/src/output_pipeline/core.rs (1)
437-437
: Optional: Remove trailing semicolon for conventional style.The semicolon after the closing brace is valid but unconventional in Rust. Most idiomatic Rust code omits it.
if let Err(e) = video_source.stop().await { error!("Video source stopped with error: {e:#}"); - }; + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
crates/recording/src/output_pipeline/core.rs
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs
: Format Rust code usingrustfmt
and ensure all Rust code passes workspace-level clippy lints.
Rust modules should be named with snake_case, and crate directories should be in kebab-case.
Files:
crates/recording/src/output_pipeline/core.rs
crates/*/src/**/*
📄 CodeRabbit inference engine (AGENTS.md)
Rust crates should place tests within the
src/
and/or a siblingtests/
directory for each crate insidecrates/*
.
Files:
crates/recording/src/output_pipeline/core.rs
⏰ 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). (3)
- GitHub Check: Build Desktop (aarch64-apple-darwin, macos-latest)
- GitHub Check: Build Desktop (x86_64-pc-windows-msvc, windows-latest)
- GitHub Check: Analyze (rust)
🔇 Additional comments (2)
crates/recording/src/output_pipeline/core.rs (2)
435-437
: Good change - consistent error handling with audio sources.This change aligns video source stop error handling with the audio source pattern (lines 512-514), where stop errors are intentionally ignored to allow graceful pipeline completion. By logging but not propagating the error, the muxer cleanup at line 439 can proceed even if the video source fails to stop cleanly, which prevents cascading failures during shutdown.
435-437
: Remove or reconsider the review comment; the error-handling pattern is appropriate and doesn't pose resource leak risks.The verification reveals that only platform-specific
VideoSource
implementations (Windows/macOS) overridestop()
with actual cleanup logic. Both implementations use additional mechanisms to ensure cleanup proceeds even ifstop()
errors:
- macOS: calls
cancel_token.cancel()
regardless ofcapturer.stop()
result- Windows: control thread management ensures cleanup through separate async coordination
ChannelVideoSource
uses the default no-opstop()
and relies entirely on Rust ownership for resource cleanup (task drops naturally when receiver is closed).Logging errors while continuing is a standard graceful shutdown pattern here—individual source failures don't prevent overall pipeline cleanup.
Likely an incorrect or invalid review comment.
Summary by CodeRabbit
Bug Fixes
Refactor