diff options
author | Martin Storsjö <martin@martin.st> | 2010-06-22 14:15:00 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-06-22 14:15:00 +0000 |
commit | 9290f15d00881ce028a5c18810a8d5af07bad2c7 (patch) | |
tree | 3dd9f2754e5fb5fdeabaa3de80ef6d9844337eff /libavformat/rtsp.c | |
parent | 4167ba0bc8d38db335dcac0f49d25c192748af51 (diff) | |
download | ffmpeg-streaming-9290f15d00881ce028a5c18810a8d5af07bad2c7.zip ffmpeg-streaming-9290f15d00881ce028a5c18810a8d5af07bad2c7.tar.gz |
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.
Originally committed as revision 23710 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r-- | libavformat/rtsp.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index fe64a5d..be63523 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1578,7 +1578,7 @@ redirect: 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 @@ redirect: 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 @@ redirect: */ 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); |