forked from globocom/m3u8
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework segment.key as segment.keys, a list of keys
This closes globocom#283 as it now follows RFC and keeps all preceding keys for the segment. - `m3u8_obj.keys` still has the same behaviour. - `m3u8_obj.segments[0].key` is now removed. - `m3u8_obj.segments[0].keys` is added in it's place, which will now always be a list. - The list will always be present, it will never be `None` anymore, and if the segment explicitly has no DRM by specifying an EXT-X-KEY of METHOD=NONE then it will be a list with that key. - It does not check if there's a METHOD=NONE with other conflicting EXT-X-KEY information. - It still follows the same behaviour of not duplicating the EXT-X-KEY information on future segments when dumping. Do note that it only clears the list of Keys when it reaches an EXT-X-DISCONTINUITY, or it has reached a ts segment. The copy() statement is used because it clears after the segment is appended to `data`, yet the .clear() to `current_keys` follows in the appended `segment` unless we copy that data in memory prior. I don't think there's a need for `.by_key()` or `m3u8_obj.keys` anymore, but I've made sure those still work as intended in case there's a different reason those exist.
- Loading branch information
1 parent
54c830c
commit e58e878
Showing
2 changed files
with
22 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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