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

Refactor and fix EXT-X-DEFINE and EXT-X-START #31

Merged
merged 4 commits into from
Jan 21, 2025
Merged

Conversation

tobbee
Copy link
Collaborator

@tobbee 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
@tobbee tobbee requested a review from Lunkers January 21, 2025 09:23
Copy link
Contributor

@Lunkers Lunkers left a 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":
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

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 :)

@tobbee tobbee merged commit 6f2d765 into main Jan 21, 2025
9 checks passed
@tobbee tobbee deleted the refactor-and-fix branch January 21, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants