Comcast / mamba

Mamba is a Swift iOS, tvOS and macOS framework to parse, validate and write HTTP Live Streaming (HLS) data.
Apache License 2.0
177 stars 37 forks source link

Implement faster EVENT style playlist parsing #32

Closed dcoufal closed 5 years ago

dcoufal commented 5 years ago

Description

EVENT style playlists just add fragments onto the end of an existing variant.

This ticket is to implement a special parsing pathway that will take a previous EVENT style variant and update it with a new version. Only a small amount of parsing will have to be done to update the HLSPlaylist object.

Tasks

dcoufal commented 5 years ago

Why is this useful?

EVENT style variants have a long list of fragments. They can only be added to the end of the playlist as time goes forward. Anything in the middle cannot be changed. This is according to the HLS spec (https://tools.ietf.org/html/draft-pantos-hls-rfc8216bis-03#section-6.2.1. The server MUST NOT change the Media Playlist file, except to: Append lines to it

So, if we have an hours long Event playlist, it's more efficient to just parse the last part of the playlist and add them to the already parsed playlist from the last update, if you are parsing HLS for playback.

This ticket is to implement such an update method. It's totally optional for users of mamba.

dcoufal commented 5 years ago

Fixed