summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorThijs Vermeir <thijs.vermeir@barco.com>2007-05-22 07:51:39 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2007-05-22 07:51:39 +0000
commit8bd32c0424ca1233137a61403d65a2b4ee03d376 (patch)
treea2a9d472e8b58b827bb6a9f0371e135718e0cbb5 /libavformat/rtsp.c
parentbadc9ae2d5f7c28b26291ef47407197e0846d327 (diff)
Add transport method options
patch by Thijs Vermeir thijs vermeir chez barco com original thread: [FFmpeg-devel] [PATCH] Add rtsp options support ( added option) Originally committed as revision 9099 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 a4330097cd..a931e62bda 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -847,7 +847,7 @@ static int rtsp_read_header(AVFormatContext *s,
RTSPHeader reply1, *reply = &reply1;
unsigned char *content = NULL;
RTSPStream *rtsp_st;
- int protocol_mask;
+ int protocol_mask = 0;
AVStream *st;
/* extract hostname and port */
@@ -868,9 +868,18 @@ static int rtsp_read_header(AVFormatContext *s,
if (option_list)
*(option_list++) = 0;
/* handle the options */
+ if (strcmp(option, "udp") == 0)
+ protocol_mask = (1<< RTSP_PROTOCOL_RTP_UDP);
+ else if (strcmp(option, "multicast") == 0)
+ protocol_mask = (1<< RTSP_PROTOCOL_RTP_UDP_MULTICAST);
+ else if (strcmp(option, "tcp") == 0)
+ protocol_mask = (1<< RTSP_PROTOCOL_RTP_TCP);
}
}
+ if (!protocol_mask)
+ protocol_mask = rtsp_default_protocols;
+
/* open the tcp connexion */
snprintf(tcpname, sizeof(tcpname), "tcp://%s:%d", host, port);
if (url_open(&rtsp_hd, tcpname, URL_RDWR) < 0)
@@ -901,8 +910,6 @@ static int rtsp_read_header(AVFormatContext *s,
goto fail;
}
- protocol_mask = rtsp_default_protocols;
-
/* for each stream, make the setup request */
/* XXX: we assume the same server is used for the control of each
RTSP stream */