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

Skip Low-Latency HLS segment and part directives after long delay #6080

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/controller/base-playlist-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,19 @@ export default class BasePlaylistController
details.targetduration * 1.5,
);
if (currentGoal > 0) {
if (previousDetails && currentGoal > previousDetails.tuneInGoal) {
if (cdnAge > details.targetduration * 3) {
// Omit segment and part directives when the last response was more than 3 target durations ago,
this.log(
`Playlist last advanced ${lastAdvanced.toFixed(
2,
)}s ago. Omitting segment and part directives.`,
);
msn = undefined;
part = undefined;
} else if (
previousDetails?.tuneInGoal &&
cdnAge - details.partTarget > previousDetails.tuneInGoal
) {
// If we attempted to get the next or latest playlist update, but currentGoal increased,
// then we either can't catchup, or the "age" header cannot be trusted.
this.warn(
Expand Down
8 changes: 7 additions & 1 deletion src/controller/level-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,13 @@ export default class LevelController extends BasePlaylistController {
if (curLevel.fragmentError === 0) {
curLevel.loadError = 0;
}
this.playlistLoaded(level, data, curLevel.details);
// Ignore matching details populated by loading a Media Playlist directly
let previousDetails = curLevel.details;
if (previousDetails === data.details && previousDetails.advanced) {
previousDetails = undefined;
}

this.playlistLoaded(level, data, previousDetails);
} else if (data.deliveryDirectives?.skip) {
// received a delta playlist update that cannot be merged
details.deltaUpdateFailed = true;
Expand Down
Loading