Repository navigation
Conversation
robwalch
reviewed
Nov 14, 2026
Comment on lines
+503
to
+510
| // A rendition may already have been slid by mergeDetails before aligning it | ||
| // with main. Apply only the difference from its existing start in that case. | ||
| const existingSliding = matchingStableVariantOrRendition | ||
| ? 0 | ||
| : newDetails.fragmentStart; | ||
| let sliding = 0; | ||
| if (advancedOrStable && delta < oldFragments.length) { | ||
| sliding = oldFragments[delta].start; | ||
| sliding = oldFragments[delta].start - existingSliding; |
Collaborator
There was a problem hiding this comment.
Is there a difference? Why is adjustSliding being called on details that were already adjusted? It should not.
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR will...
Keep live WebVTT subtitles aligned after playlist refreshes.
Why is this Pull Request needed?
In the stream from #8159, captions appear initially and then disappear while playback continues. After
mergeDetailshas already shifted a subtitle playlist, the sequence-number fallback adds the main playlist's start again on each refresh.Keep the start that a playlist already acquired when sequence numbers are the only remaining alignment hint. The sequence fallback still aligns fresh playlists. When a configured timeline offset is present, apply it once on refresh and include it in the trailing LL-HLS part.
hls-live-subtitle-drift-before-after.mp4
The clip shows the original reproduction and first fix in the project demo. Waiting time is omitted. The latest revision was replayed on the same public live stream, and subtitles were still visible after 22 playlist loads.
Are there any points in the code the reviewer needs to double check?
The guard sits after discontinuity and Program Date Time alignment, so those paths can still refine a playlist's start. Same-rendition updates with a configured offset avoid applying it twice.
npm run sanity-checkpasses, including 1,290 unit tests. Regressions cover successive refreshes, previously shifted playlists, a configured offset, and the trailing part hint. All 36 selected PDT, alternate-audio, and low-latency playback checks pass in Chromium. The Apple advanced sample remains unverified, with afragLoadErrorobserved in the earlier baseline and PR runs.Resolves issues:
Fixes #8159
Checklist