[vlc-commits] dash: set segment url relative if url is not valid

Christopher Mueller git at videolan.org
Wed Feb 22 11:47:54 CET 2012


vlc | branch: master | Christopher Mueller <christopher.mueller at itec.aau.at> | Mon Feb 20 19:17:42 2012 +0100| [bd8e9334da4cd1b03cd68d1828577dc07904e9b3] | committer: Hugo Beauzée-Luyssen

dash: set segment url relative if url is not valid

Signed-off-by: Hugo Beauzée-Luyssen <beauze.h at gmail.com>

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

 modules/stream_filter/dash/http/HTTPConnection.cpp |   12 ++++++++++--
 modules/stream_filter/dash/http/HTTPConnection.h   |    1 +
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/modules/stream_filter/dash/http/HTTPConnection.cpp b/modules/stream_filter/dash/http/HTTPConnection.cpp
index f98c9c7..951df6f 100644
--- a/modules/stream_filter/dash/http/HTTPConnection.cpp
+++ b/modules/stream_filter/dash/http/HTTPConnection.cpp
@@ -74,8 +74,16 @@ int             HTTPConnection::peek            (const uint8_t **pp_peek, size_t
 }
 void            HTTPConnection::parseURL        ()
 {
-    this->hostname = this->url;
-    this->hostname.erase(0, 7);
+    if(this->url.compare(0, 4, "http"))
+    {
+        this->hostname = Helper::combinePaths(Helper::getDirectoryPath(stream->psz_path), this->url);
+    }
+    else
+    {
+        this->hostname = this->url;
+        this->hostname.erase(0, 7);
+    }
+
     this->path = this->hostname;
 
     size_t pos = this->hostname.find("/");
diff --git a/modules/stream_filter/dash/http/HTTPConnection.h b/modules/stream_filter/dash/http/HTTPConnection.h
index 7cb97a0..978ff2e 100644
--- a/modules/stream_filter/dash/http/HTTPConnection.h
+++ b/modules/stream_filter/dash/http/HTTPConnection.h
@@ -37,6 +37,7 @@
 
 #include "http/IHTTPConnection.h"
 #include "http/Chunk.h"
+#include "Helper.h"
 
 #define PEEKBUFFER 4096
 



More information about the vlc-commits mailing list