Repository navigation
Conversation
A SABR response carries about twenty seconds of audio and video, and the caller that sent the request waited for all of it: the media source was only created once the whole first response had been read, and after a seek the player got its first segment when the last one had arrived. On a slow connection that is the wait for a couple of megabytes before the first frame. Requests now run on their own thread. Callers wait for what they asked for, the timelines or one segment, and return as soon as it is there while the rest of the response keeps streaming into the cache. Waiting callers are woken up instead of polling every 100 ms. A request is stopped when the caller it was started for is cancelled and nobody else waits, or when a segment is asked that it cannot carry, so a seek still interrupts the response it makes useless.
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.
A SABR response carries about 20 s of audio and video (2 to 2.6 MB at 720p). The caller that sends the request waits for all of it: the media source is only created once the whole first response is read, and after a seek the player gets its first segment when the last one has arrived. On a good connection nobody notices, on a slow one it's the wait for 2.5 MB before the first frame.
Now the request runs on its own thread in
SabrMediaBridge. Callers wait for what they asked for (the timelines, or one segment) and return as soon as it is there, while the rest of the response keeps streaming into the cache. Waiting callers are woken up instead of retrying every 100 ms.A request is stopped when the caller it was started for is cancelled and nobody else waits, or when a segment is asked that it can't carry, so a seek still interrupts the response it makes useless, like before.
Validation, warm start of the same video: