Repository navigation
Fix #EXTINF durations without digits after the decimal point creating bogus segments - #8113
Merged
robwalch merged 1 commit intoOct 22, 2026
Conversation
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...
Accept
#EXTINFdurations that have no digits after the decimal point, such as#EXTINF:10.,. The duration group inLEVEL_PLAYLIST_REGEX_FASTwas(\d*(?:\.\d+)?), which requires a digit after the dot. It is now(\d+(?:\.\d*)?|\.\d+)?.Why is this Pull Request needed?
RFC 8216 defines a decimal-floating-point as characters from
[0-9]and., so10.is a valid duration. The old pattern only captured10. The leftover.,(or.,title) on the same line then matched the segment URI alternative. For this playlist:master parses 4 fragments:
.,(10s),segment-1.ts(0s),.,title(4s) andsegment-2.ts(0s). The made-up URLs fail to load, and the real segments get a duration of 0. With this change the playlist parses as 2 fragments of 10s and 4s, and the title is kept.Are there any points in the code the reviewer needs to double check?
10,10.5and.36still parse the same way. The existing "without a leading digit" test covers.36..does not match the group, which is the same as before, so malformed lines behave as they did.Resolves issues:
Fixes #8112
Checklist
Unit tests: 1242 passed. The new test fails on master with 4 fragments instead of 2. lint, prettier and type-check are clean.