stream.hls: move sequence counter to base class#6707
Merged
bastimeyer merged 4 commits intoNov 5, 2025
Conversation
Rename `playlist_sequence` to `sequence` and move it to its base class
- Pass the worker's `sequence` to the segments iterator, so the MPD doesn't need to remember the `SegmentList` sequence when reloading the manifest. - Remove the sequence gap warning from the parser and instead use the worker's warnings, according to the segment number - Remove duplicate `self.closed` check in the segments iterator - Update tests
Move `check_sequence_gap()` from the HLS/DASH workers to the base class
232dee0 to
fd2f141
Compare
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.
The goal of this code refactor (and upcoming ones) is to move as much common code from the HLS and DASH implementations to their common base class. This is one of the first steps.
sequencecounter fromHLSStreamWorkerto the baseSegmentedStreamWorker, so that the DASH implementation can utilize the same logic later (stream.segmented: add --stream-segmented-duration #6705 from last week has already moved thedurationcounter). None of the Writer/Worker/Reader/Stream code is considered a public interface apart from the main Stream constructor and respective classmethod, so renaming attributes is not considered a breaking change, even though some of Streamlink's plugins require an update. If this breaks third party plugins, then those will require a fix. I'm always a bit careful about this...DASHStreamWorkerand pass it to the MPD parser'ssegments()generator, soSegmentListmanifests which require reloads don't have to pass the sequence counter from MPD object to MPD object. This also removes the gap warnings from the parser and re-uses the worker's gap warnings.Upcoming changes will (hopefully) be