-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Schedule level reload sooner if only 1 fragment in level #7453
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
Open
flagoworld
wants to merge
1
commit into
video-dev:master
Choose a base branch
from
flagoworld:bugfix/schedule-refresh-sooner-if-one-segment
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
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.
Couldn't this work in the block above? (4x segment duration is > distance to end of one segment.)
The problem with this whole idea is that if you only ever serve one segment, the server will keep getting hit at twice the rate of normal.
My suggestion would be to not even start playback until there are three segments present.
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.
Is that even possible? Wouldn’t the END-LIST tag be present if there were only 1 and it would never try to load more?
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.
Serving a static playlist with no end list is pretty simple. Static playlists should have one.
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.
Not debating/arguing, but looking to understand the spec better, so please be patient with me:
I skimmed over the spec and I am not seeing anything about minimum 3 fragments. Can you point me to where it discusses that?
Looking at the spec, it says:
If the Media Playlist contains the final Media Segment of the presentation, then the Playlist file MUST contain the EXT-X-ENDLIST tag; this allows clients to minimize unproductive Playlist reloads.If we check for the EXT--X-PLAYLIST-TYPE == EVENT, we can then determine if we even need to schedule a reload at all, right, so this would prevent any kind of infinite reload condition there. END-LIST is REQUIRED for EVENT playlists.
How would requesting an update sooner when there is only 1 fragment lead to more updates than requesting it near the end if there is still only 1 update scheduled during the playback of that fragment? Actually, come to think of it, the goal is to make sure to do an update well before the playing fragment ends if the playing fragment is the last fragment. Would it make sense to change the logic as such? Not even sure at a glance if that information is available in this scope, but I think it would fix the issue without breaking anything? An honestly that logic may be better up in the level-controller as well?:
If playing last fragment, reloadInterval /= 2.Uh oh!
There was an error while loading. Please reload this page.
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.
Have a look at the sections that cover HOLD-BACK and "three Target Durations" and "three times the Target Duration". I'm sure that if you are encoding a playlist, the rate of growth of the playlist will be greater than 1x, but this is a special case. You should delay the start of playback rather than increase the rate of playlist polling.
Cutting the reload interval is not something I am willing to do. In case of a miss (no update after refresh) then the next refresh should should wait another target duration (not half), but that wouldn't be the case with this change. The likeliness of a stall in most cases (where the playlist grows at a rate of 1x) are still very high.
Arbitrarily cutting the reload in half when there is an eminent stall deadline is not ideal. This is a special app case that should be handled by the app, based on distance to the edge: reload before
hls.latencyseconds when there is one segment andhls.latestLevelDetails.live.