[FFmpeg-cvslog] r9098 - trunk/libavformat/rtsp.c

benoit subversion
Tue May 22 09:47:05 CEST 2007


Author: benoit
Date: Tue May 22 09:47:04 2007
New Revision: 9098

Log:

Add support for options
patch by Thijs Vermeir thijs vermeir chez barco com
original thread:
[FFmpeg-devel] [PATCH] Add rtsp options support ( added option)



Modified:
   trunk/libavformat/rtsp.c

Modified: trunk/libavformat/rtsp.c
==============================================================================
--- trunk/libavformat/rtsp.c	(original)
+++ trunk/libavformat/rtsp.c	Tue May 22 09:47:04 2007
@@ -841,7 +841,7 @@ static int rtsp_read_header(AVFormatCont
                             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(AVFormatCont
     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)




More information about the ffmpeg-cvslog mailing list