summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2009-02-01 13:37:45 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2009-02-01 13:37:45 +0000
commitd1c6e47c16db449bc79eb144fbb6fcdaf160b119 (patch)
tree4d8a7fa60ec91a430a1a8190d8e872d691130c98 /libavformat/rtsp.c
parent82aaa790d2fb848b208b82fc3fe49e97f6d54e50 (diff)
Fix the Transport: line in the SETUP request so that it works with WMS
servers when trying to set up a session over TCP: - add the interleave property - add unicast, only for WMS (since it is normally only UDP, but WMS expects it for UDP and TCP) - add mode=play See discussion in "[PATCH] RTSP-MS 9/15: add interleave property to the TCP transport line of the SETUP request" thread on mailinglist. Originally committed as revision 16913 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 1db4a7feb2..116383e1b9 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -886,7 +886,7 @@ make_setup_request (AVFormatContext *s, const char *host, int port,
int lower_transport, const char *real_challenge)
{
RTSPState *rt = s->priv_data;
- int j, i, err;
+ int j, i, err, interleave = 0;
RTSPStream *rtsp_st;
RTSPHeader reply1, *reply = &reply1;
char cmd[2048];
@@ -943,14 +943,21 @@ make_setup_request (AVFormatContext *s, const char *host, int port,
/* RTP/TCP */
else if (lower_transport == RTSP_LOWER_TRANSPORT_TCP) {
snprintf(transport, sizeof(transport) - 1,
- "%s/TCP", trans_pref);
+ "%s/TCP;", trans_pref);
+ if (rt->server_type == RTSP_SERVER_WMS)
+ av_strlcat(transport, "unicast;", sizeof(transport));
+ av_strlcatf(transport, sizeof(transport),
+ "interleaved=%d-%d",
+ interleave, interleave + 1);
+ interleave += 2;
}
else if (lower_transport == RTSP_LOWER_TRANSPORT_UDP_MULTICAST) {
snprintf(transport, sizeof(transport) - 1,
"%s/UDP;multicast", trans_pref);
}
- if (rt->server_type == RTSP_SERVER_REAL)
+ if (rt->server_type == RTSP_SERVER_REAL ||
+ rt->server_type == RTSP_SERVER_WMS)
av_strlcat(transport, ";mode=play", sizeof(transport));
snprintf(cmd, sizeof(cmd),
"SETUP %s RTSP/1.0\r\n"