Skip to content
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

Request LL-HLS playlists with _HLS_part param starting at 0 for next sn #3784

Merged
merged 1 commit into from Apr 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/controller/base-playlist-controller.ts
Expand Up @@ -138,16 +138,18 @@ export default class BasePlaylistController implements NetworkComponentAPI {
if (details.canBlockReload && details.endSN && details.advanced) {
// Load level with LL-HLS delivery directives
const lowLatencyMode = this.hls.config.lowLatencyMode;
const lastPartSn = details.lastPartSn;
const endSn = details.endSN;
const lastPartIndex = details.lastPartIndex;
if (lowLatencyMode) {
msn = lastPartIndex !== -1 ? details.lastPartSn : details.endSN + 1;
part = lastPartIndex !== -1 ? lastPartIndex + 1 : undefined;
const hasParts = lastPartIndex !== -1;
const lastPart = lastPartSn === endSn;
// When low latency mode is disabled, we'll skip part requests once the last part index is found
const nextSnStartIndex = lowLatencyMode ? 0 : lastPartIndex;
if (hasParts) {
msn = lastPart ? endSn + 1 : lastPartSn;
part = lastPart ? nextSnStartIndex : lastPartIndex + 1;
} else {
// This playlist update will be late by one part (0). There is no way to know the last part number,
// or request just the next sn without a part in most implementations.
msn =
lastPartIndex !== -1 ? details.lastPartSn + 1 : details.endSN + 1;
part = lastPartIndex !== -1 ? 0 : undefined;
msn = endSn + 1;
}
// Low-Latency CDN Tune-in: "age" header and time since load indicates we're behind by more than one part
// Update directives to obtain the Playlist that has the estimated additional duration of media
Expand Down