[vlc-devel] [PATCH 1/2] dash: set segment url relative if url is not valid
Christopher at mailsrv.uni-klu.ac.at
Christopher at mailsrv.uni-klu.ac.at
Mon Feb 20 19:17:42 CET 2012
From: Christopher Mueller <christopher.mueller at itec.aau.at>
---
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
--
1.7.0.4
More information about the vlc-devel
mailing list