-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor and fix EXT-X-DEFINE and EXT-X-START #31
Conversation
tobbee
commented
Jan 19, 2025
- Refactored EXT-X-DEFINE
- Fixed EXT-X-START write for negative values
- Added EXT-X-START to media playlist
Both positive and negative offsets are allowed. The tag can appear in both master and media playlist
46b15e8
to
b008de3
Compare
b008de3
to
710fbdc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good improvement on legibility for the reader! Added one comment about adding guardrails, but that could be a separate PR if we decide to go that route.
|
||
for _, attr := range decodeAttributes(parameters) { | ||
switch attr.Key { | ||
case "TIME-OFFSET": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When parsing the time offset, should we return an error if the offset value does not conform to the spec?
from the RFC:
The absolute value of TIME-OFFSET SHOULD NOT be larger than the
Playlist duration. If the absolute value of TIME-OFFSET exceeds
the duration of the Playlist, it indicates either the end of the
Playlist (if positive) or the beginning of the Playlist (if
negative).
If the Playlist does not contain the EXT-X-ENDLIST tag, the TIME-
OFFSET SHOULD NOT be within three Target Durations of the end of
the Playlist file.
This might be overkill and hard to do with the structure of the packager, but could also be a nice to have feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be useful, but, in my view, we should parse everything that is syntactically valid including if the version is wrong or some values too big or small, and then let the application, or a special validation phase handle such things.
Let's ponder it for later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a valid decision to make. In that case, feel free to merge whenever :)