diff rtsp.c @ 6164:72ea866c62fd libavformat

Make the http protocol open the connection immediately in http_open again Also make the RTSP protocol use url_alloc and url_connect instead of relying on the delay open behaviour.
author mstorsjo
date Tue, 22 Jun 2010 14:15:00 +0000
parents f403b7c0e51b
children 0e737c9247fd
line wrap: on
line diff
--- a/rtsp.c	Tue Jun 22 14:13:55 2010 +0000
+++ b/rtsp.c	Tue Jun 22 14:15:00 2010 +0000
@@ -1578,7 +1578,7 @@
                  av_get_random_seed(), av_get_random_seed());
 
         /* GET requests */
-        if (url_open(&rt->rtsp_hd, httpname, URL_RDONLY) < 0) {
+        if (url_alloc(&rt->rtsp_hd, httpname, URL_RDONLY) < 0) {
             err = AVERROR(EIO);
             goto fail;
         }
@@ -1593,13 +1593,13 @@
         ff_http_set_headers(rt->rtsp_hd, headers);
 
         /* complete the connection */
-        if (url_read(rt->rtsp_hd, NULL, 0)) {
+        if (url_connect(rt->rtsp_hd)) {
             err = AVERROR(EIO);
             goto fail;
         }
 
         /* POST requests */
-        if (url_open(&rt->rtsp_hd_out, httpname, URL_WRONLY) < 0 ) {
+        if (url_alloc(&rt->rtsp_hd_out, httpname, URL_WRONLY) < 0 ) {
             err = AVERROR(EIO);
             goto fail;
         }
@@ -1634,6 +1634,11 @@
          */
         ff_http_init_auth_state(rt->rtsp_hd_out, rt->rtsp_hd);
 
+        /* complete the connection */
+        if (url_connect(rt->rtsp_hd_out)) {
+            err = AVERROR(EIO);
+            goto fail;
+        }
     } else {
         /* open the tcp connection */
         ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, host, port, NULL);