changeset 5894:51c410f2251b libavformat

Reassemble the RTSP URL before replacing hostname with the numerical IP
author mstorsjo
date Thu, 25 Mar 2010 22:21:09 +0000
parents 046e46b938d5
children d8031a05ceec
files rtsp.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/rtsp.c	Thu Mar 25 22:04:41 2010 +0000
+++ b/rtsp.c	Thu Mar 25 22:21:09 2010 +0000
@@ -1505,6 +1505,12 @@
         }
     }
 
+    /* Construct the URI used in request; this is similar to s->filename,
+     * but with authentication credentials removed and RTSP specific options
+     * stripped out. */
+    ff_url_join(rt->control_uri, sizeof(rt->control_uri), "rtsp", NULL,
+                host, port, "%s", path);
+
     /* open the tcp connexion */
     ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, host, port, NULL);
     if (url_open(&rtsp_hd, tcpname, URL_RDWR) < 0) {
@@ -1520,11 +1526,6 @@
                     NULL, 0, NI_NUMERICHOST);
     }
 
-    /* Construct the URI used in request; this is similar to s->filename,
-     * but with authentication credentials removed and RTSP specific options
-     * stripped out. */
-    ff_url_join(rt->control_uri, sizeof(rt->control_uri), "rtsp", NULL,
-                host, port, "%s", path);
     /* request options supported by the server; this also detects server
      * type */
     for (rt->server_type = RTSP_SERVER_RTP;;) {