[vlc-commits] demux: hls: preload SESSION-KEY

Francois Cartegnie git at videolan.org
Fri May 10 11:13:31 CEST 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Apr 23 16:46:10 2019 +0200| [540c383f00c24627c101df6dcb58492bf8846f59] | committer: Francois Cartegnie

demux: hls: preload SESSION-KEY

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=540c383f00c24627c101df6dcb58492bf8846f59
---

 modules/demux/hls/playlist/Parser.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/demux/hls/playlist/Parser.cpp b/modules/demux/hls/playlist/Parser.cpp
index 18e372b1d4..3574fedf2e 100644
--- a/modules/demux/hls/playlist/Parser.cpp
+++ b/modules/demux/hls/playlist/Parser.cpp
@@ -432,12 +432,18 @@ M3U8 * M3U8Parser::parse(vlc_object_t *p_object, stream_t *p_stream, const std::
         std::list<Tag *>::const_iterator it;
         std::map<std::string, AttributesTag *> groupsmap;
 
+        /* Preload Session Key */
         Tag *sessionKey = getTagFromList(tagslist, AttributesTag::EXTXSESSIONKEY);
         if(sessionKey)
         {
             CommonEncryption sessionEncryption;
-            parseEncryption(static_cast<const AttributesTag *>(sessionKey),
-                            playlist->getUrlSegment(), sessionEncryption);
+            if(parseEncryption(static_cast<const AttributesTag *>(sessionKey),
+                                playlist->getUrlSegment(), sessionEncryption) &&
+               !sessionEncryption.uri.empty())
+            {
+                resources->getKeyring()->getKey(resources->getAuthStorage(),
+                                                sessionEncryption.uri);
+            }
         }
 
         /* We'll need to create an adaptation set for each media group / alternative rendering



More information about the vlc-commits mailing list