From 3b70175e193965f69f7ccca5edcc07cd8b0d55f4 Mon Sep 17 00:00:00 2001 From: youwen Date: Fri, 21 Jun 2024 08:14:23 +0800 Subject: [PATCH 1/2] fix #EXT-X-KEY:METHOD=NONE #EXT-X-KEY:METHOD=NONE --- reader.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reader.go b/reader.go index caf021bc..f773677a 100644 --- a/reader.go +++ b/reader.go @@ -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": @@ -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) From e54c5f6dbb8682500cc0db1b9c9384c065455465 Mon Sep 17 00:00:00 2001 From: youwen Date: Fri, 21 Jun 2024 08:15:54 +0800 Subject: [PATCH 2/2] Update reader.go --- reader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reader.go b/reader.go index f773677a..861b9da4 100644 --- a/reader.go +++ b/reader.go @@ -637,7 +637,7 @@ func decodeLineOfMediaPlaylist(p *MediaPlaylist, wv *WV, state *decodingState, l } } state.tagKey = true - if strings.ToUpper(decryptMethod) != "NONE" { + if strings.ToUpper(decryptMethod) == "NONE" { state.tagKey = false state.xkey = nil }