Skip to content

Commit

Permalink
Fix blocking playlist requests with lowLatencyMode is set to false
Browse files Browse the repository at this point in the history
Resolves #3566
  • Loading branch information
Rob Walch committed Apr 16, 2021
1 parent b3e9457 commit 82244ea
Showing 1 changed file with 18 additions and 11 deletions.
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

0 comments on commit 82244ea

Please sign in to comment.