]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
IPTV: fix mm_iptv_url_sane build - add the UDP/TCP port number
authorJaroslav Kysela <perex@perex.cz>
Wed, 6 May 2015 10:29:47 +0000 (12:29 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 6 May 2015 10:29:47 +0000 (12:29 +0200)
src/input/mpegts/iptv/iptv_mux.c

index f884666baa9e289dac7a60b4d14d634dc776015a..f220601854c11879629a171c282acc1f96ab9b73 100644 (file)
@@ -66,13 +66,13 @@ iptv_mux_url_set ( void *p, const void *v )
               (url.path ? strlen(url.path) + 1 : 0) +
               (url.query ? strlen(url.query) + 2 : 0);
         buf = alloca(len);
-        if (url.port)
-          snprintf(port, sizeof(port), "%d", url.port);
-        snprintf(buf, len, "%s%s%s%s%s%s",
+        if (url.port > 0 && url.port <= 65535)
+          snprintf(port, sizeof(port), ":%d", url.port);
+        snprintf(buf, len, "%s%s%s%s%s%s%s",
                  url.scheme ?: "", url.scheme ? "://" : "",
-                 url.host ?: "",
+                 url.host ?: "", port,
                  url.path ?: "", url.query ? "?" : "",
-                 url.query);
+                 url.query ?: "");
         im->mm_iptv_url_sane = strdup(buf);
       } else {
         im->mm_iptv_url_sane = NULL;