[vlc-commits] https: redirect to MMS over HTTP (fixes #16180)

Rémi Denis-Courmont git at videolan.org
Wed Dec 23 17:15:23 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 23 18:14:17 2015 +0200| [8005f40e980e9ff16edafd0123dea15fcc3ccdba] | committer: Rémi Denis-Courmont

https: redirect to MMS over HTTP (fixes #16180)

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

 modules/access/http/resource.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/access/http/resource.c b/modules/access/http/resource.c
index 27ebb81..abd4a31 100644
--- a/modules/access/http/resource.c
+++ b/modules/access/http/resource.c
@@ -200,6 +200,15 @@ char *vlc_http_res_get_redirect(const struct vlc_http_resource *restrict res,
      || status == 306 /* Switch Proxy (former) */)
         return NULL;
 
+    if (!res->secure
+     && vlc_http_msg_get_token(resp, "Pragma", "features") != NULL)
+    {   /* HACK: Seems like an MMS server. Redirect to MMSH scheme. */
+        char *url;
+
+        if (asprintf(&url, "mmsh://%s%s", res->authority, res->path) >= 0)
+            return url;
+    }
+
     const char *location = vlc_http_msg_get_header(resp, "Location");
     if (location == NULL)
         return NULL;



More information about the vlc-commits mailing list