[vlc-commits] commit: stream_filter/httplive.c: use check username/ password in relative_URI() (Jean-Paul Saman )

git at videolan.org git at videolan.org
Wed Dec 29 16:51:16 CET 2010


vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Wed Dec 29 15:17:49 2010 +0100| [e2cac80ee9015cf4aee56950c022013805135def] | committer: Jean-Paul Saman 

stream_filter/httplive.c: use check username/password in relative_URI()

If a username and password are suplied, then use it when constructing the
URI.

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

 modules/stream_filter/httplive.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 95e7be2..f875854 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -348,10 +348,20 @@ static char *relative_URI(stream_t *s, const char *uri, const char *path)
         return NULL;
 
     char *psz_uri = NULL;
-    if (asprintf(&psz_uri, "%s://%s%s/%s", p_sys->m3u8.psz_protocol,
+    if (p_sys->m3u8.psz_password || p_sys->m3u8.psz_username)
+    {
+        if (asprintf(&psz_uri, "%s://%s:%s@%s%s/%s", p_sys->m3u8.psz_protocol,
+                     p_sys->m3u8.psz_username, p_sys->m3u8.psz_password,
+                     p_sys->m3u8.psz_host,
+                     path ? path : p_sys->m3u8.psz_path, uri) < 0)
+            return NULL;
+    }
+    else
+    {
+        if (asprintf(&psz_uri, "%s://%s%s/%s", p_sys->m3u8.psz_protocol,
                  p_sys->m3u8.psz_host, path ? path : p_sys->m3u8.psz_path, uri) < 0)
-        return NULL;
-
+           return NULL;
+    }
     return psz_uri;
 }
 



More information about the vlc-commits mailing list