Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

fix #EXT-X-KEY:METHOD=NONE #211

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,12 @@ func decodeLineOfMediaPlaylist(p *MediaPlaylist, wv *WV, state *decodingState, l
case strings.HasPrefix(line, "#EXT-X-KEY:"):
state.listType = MEDIA
state.xkey = new(Key)
decryptMethod := ""
for k, v := range decodeParamsLine(line[11:]) {
switch k {
case "METHOD":
state.xkey.Method = v
decryptMethod = strings.TrimSpace(v)
case "URI":
state.xkey.URI = v
case "IV":
Expand All @@ -635,6 +637,10 @@ func decodeLineOfMediaPlaylist(p *MediaPlaylist, wv *WV, state *decodingState, l
}
}
state.tagKey = true
if strings.ToUpper(decryptMethod) == "NONE" {
state.tagKey = false
state.xkey = nil
}
case strings.HasPrefix(line, "#EXT-X-MAP:"):
state.listType = MEDIA
state.xmap = new(Map)
Expand Down