[vlc-devel] [PATCH 7/7] dash: set segment url relative if url is not valid
Hugo Beauzée-Luyssen
beauze.h at gmail.com
Mon Feb 20 18:51:38 CET 2012
On Mon, Feb 20, 2012 at 1:51 PM, <Christopher at mailsrv.uni-klu.ac.at> wrote:
> 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..07ab958 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.find("http") == std::string::npos)
You should use std::string::compare to compare the first caracters
only. This would return a false positive if the url contains a "http"
string for some reasons.
> + {
> + 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
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
--
Hugo Beauzée-Luyssen
More information about the vlc-devel
mailing list