summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorThijs Vermeir <thijs.vermeir@barco.com>2007-05-22 07:47:04 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2007-05-22 07:47:04 +0000
commitbadc9ae2d5f7c28b26291ef47407197e0846d327 (patch)
treeb367ee6d24f253b8a294791946e8cd16abf4bce3 /libavformat
parentf353fbd205d0b90fb66e8c4bbb80b40b2807a3d2 (diff)
Add support for 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 9098 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/rtsp.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 2a7f7eb4da..a4330097cd 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -841,7 +841,7 @@ static int rtsp_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
RTSPState *rt = s->priv_data;
- char host[1024], path[1024], tcpname[1024], cmd[2048];
+ char host[1024], path[1024], tcpname[1024], cmd[2048], *option_list, *option;
URLContext *rtsp_hd;
int port, i, j, ret, err;
RTSPHeader reply1, *reply = &reply1;
@@ -856,6 +856,21 @@ static int rtsp_read_header(AVFormatContext *s,
if (port < 0)
port = RTSP_DEFAULT_PORT;
+ /* search for options */
+ option_list = strchr(path, '?');
+ if (option_list) {
+ /* remove the options from the path */
+ *option_list++ = 0;
+ while(option_list) {
+ /* move the option pointer */
+ option = option_list;
+ option_list = strchr(option_list, '&');
+ if (option_list)
+ *(option_list++) = 0;
+ /* handle the options */
+ }
+ }
+
/* open the tcp connexion */
snprintf(tcpname, sizeof(tcpname), "tcp://%s:%d", host, port);
if (url_open(&rtsp_hd, tcpname, URL_RDWR) < 0)