[vlc-commits] demux: hls: handle key relative uri

Francois Cartegnie git at videolan.org
Tue Oct 6 00:22:27 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Oct  6 00:21:24 2015 +0200| [9fce6fdc36bbf345c5ed04513326981acf4df747] | committer: Francois Cartegnie

demux: hls: handle key relative uri

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

 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 f9a272e..9f44cc9 100644
--- a/modules/demux/hls/playlist/Parser.cpp
+++ b/modules/demux/hls/playlist/Parser.cpp
@@ -266,8 +266,14 @@ void M3U8Parser::parseSegments(vlc_object_t *p_obj, Representation *rep, const s
                     encryption.method = SegmentEncryption::AES_128;
                     encryption.key.clear();
                     uint8_t *p_data;
-                    const uint64_t read = Retrieve::HTTP(p_obj, keytag->getAttributeByName("URI")->quotedString(),
-                                                         (void **) &p_data);
+
+                    Url keyurl(keytag->getAttributeByName("URI")->quotedString());
+                    if(!keyurl.hasScheme())
+                    {
+                        keyurl.prepend(Helper::getDirectoryPath(rep->getPlaylistUrl().toString()).append("/"));
+                    }
+
+                    const uint64_t read = Retrieve::HTTP(p_obj, keyurl.toString(), (void **) &p_data);
                     if(p_data)
                     {
                         if(read == 16)



More information about the vlc-commits mailing list