WHIP / WHEP input required single track fixed.#1968
Open
JBRS307 wants to merge 3 commits into
Open
Conversation
WHIP input required track handling by dropping senders.
wkozyra95
reviewed
May 7, 2026
WHIP input required track handling by dropping senders.WHIP input required track handled.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates WHIP input track startup handling to avoid required inputs blocking indefinitely by ensuring unused queue track senders are eventually dropped, and adjusts the on-track handler to coordinate sender consumption safely across callbacks.
Changes:
- Wrap WHIP video/audio
QueueSenderhandles inArc<Mutex<Option<_>>>and consume them via locking inhandle_on_track. - Add a background timeout task that drops WHIP track senders if the corresponding
on_trackcallback does not arrive within a fixed window. - Update the demo WHIP input registration example to set
"required": true.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| smelter-core/src/pipeline/webrtc/whip_input/on_track.rs | Switch sender passing to Arc<Mutex<Option<...>>> and take senders under a lock when tracks start. |
| smelter-core/src/pipeline/webrtc/whip_input/create_new_session.rs | Create mutex-protected senders and spawn a timeout task to drop unused senders. |
| integration-tests/examples/demo/inputs/whip.rs | Mark demo WHIP input as required. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+101
to
+105
| tokio::spawn(async move { | ||
| tokio::time::sleep(Duration::from_secs(2)).await; | ||
| let mut video_sender = video_sender.lock().unwrap(); | ||
| let mut audio_sender = audio_sender.lock().unwrap(); | ||
| if video_sender.is_some() { |
0cb9df8 to
3b240c7
Compare
WHIP input required track handled.WHIP / WHEP input required track handled.
db2a4dc to
7c13e68
Compare
Comment on lines
+98
to
+100
| // Drop senders if appropriate tracks do not come within 2 seconds. | ||
| wait_for_tracks(video_sender.clone(), audio_sender.clone()); | ||
|
|
| let audio_sender = Arc::new(Mutex::new(audio_sender)); | ||
|
|
||
| // Drop senders if appropriate tracks do not come within 2 seconds. | ||
| wait_for_tracks(video_sender.clone(), audio_sender.clone()); |
7c13e68 to
dd7adbb
Compare
12 tasks
WHIP / WHEP input required track handled.WHIP / WHEP input required single track fixed.
741c1b0 to
286a7ab
Compare
286a7ab to
43de7cd
Compare
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.
Fixes the issue where the video or audio only required track stalls the whole queue.