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

Fix blocking playlist requests with lowLatencyMode is set to false #3792

Merged
merged 1 commit into from Apr 19, 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
29 changes: 18 additions & 11 deletions src/controller/base-playlist-controller.ts
Expand Up @@ -133,6 +133,7 @@ export default class BasePlaylistController implements NetworkComponentAPI {
if (!this.canLoad || !details.live) {
return;
}
let deliveryDirectives: HlsUrlParameters;
let msn: number | undefined = undefined;
let part: number | undefined = undefined;
if (details.canBlockReload && details.endSN && details.advanced) {
Expand Down Expand Up @@ -186,25 +187,31 @@ export default class BasePlaylistController implements NetworkComponentAPI {
}
details.tuneInGoal = currentGoal;
}
const deliveryDirectives = this.getDeliveryDirectives(
deliveryDirectives = this.getDeliveryDirectives(
details,
data.deliveryDirectives,
msn,
part
);
this.loadPlaylist(deliveryDirectives);
return;
if (lowLatencyMode || !lastPart) {
this.loadPlaylist(deliveryDirectives);
return;
}
} else {
deliveryDirectives = this.getDeliveryDirectives(
details,
data.deliveryDirectives,
msn,
part
);
}
let reloadInterval = computeReloadInterval(details, stats);
if (msn !== undefined && details.canBlockReload) {
reloadInterval -= details.partTarget || 1;
}
const reloadInterval = computeReloadInterval(details, stats);
this.log(
`reload live playlist ${index} in ${Math.round(reloadInterval)} ms`
);
const deliveryDirectives = this.getDeliveryDirectives(
details,
data.deliveryDirectives,
msn,
part
);
this.timer = self.setTimeout(
() => this.loadPlaylist(deliveryDirectives),
reloadInterval
Expand All @@ -219,7 +226,7 @@ export default class BasePlaylistController implements NetworkComponentAPI {
previousDeliveryDirectives: HlsUrlParameters | null,
msn?: number,
part?: number
) {
): HlsUrlParameters {
let skip = getSkipValue(details, msn);
if (previousDeliveryDirectives?.skip && details.deltaUpdateFailed) {
msn = previousDeliveryDirectives.msn;
Expand Down