[FFmpeg-cvslog] r25755 - in trunk/libavformat: rtsp.c rtsp.h rtspdec.c

mstorsjo subversion
Mon Nov 15 16:08:54 CET 2010


Author: mstorsjo
Date: Mon Nov 15 16:08:53 2010
New Revision: 25755

Log:
rtsp: Parse and use the Content-Base reply header, if present

This fixes playing RTSP urls with query parameters.

Modified:
   trunk/libavformat/rtsp.c
   trunk/libavformat/rtsp.h
   trunk/libavformat/rtspdec.c

Modified: trunk/libavformat/rtsp.c
==============================================================================
--- trunk/libavformat/rtsp.c	Mon Nov 15 10:30:20 2010	(r25754)
+++ trunk/libavformat/rtsp.c	Mon Nov 15 16:08:53 2010	(r25755)
@@ -706,6 +706,9 @@ void ff_rtsp_parse_line(RTSPMessageHeade
     } else if (av_stristart(p, "Authentication-Info:", &p) && auth_state) {
         p += strspn(p, SPACE_CHARS);
         ff_http_auth_handle_header(auth_state, "Authentication-Info", p);
+    } else if (av_stristart(p, "Content-Base:", &p)) {
+        p += strspn(p, SPACE_CHARS);
+        av_strlcpy(reply->content_base, p , sizeof(reply->content_base));
     }
 }
 

Modified: trunk/libavformat/rtsp.h
==============================================================================
--- trunk/libavformat/rtsp.h	Mon Nov 15 10:30:20 2010	(r25754)
+++ trunk/libavformat/rtsp.h	Mon Nov 15 16:08:53 2010	(r25755)
@@ -165,6 +165,10 @@ typedef struct RTSPMessageHeader {
      * returned
      */
     char reason[256];
+
+    /** The "Content-Base:" field.
+     */
+    char content_base[4096];
 } RTSPMessageHeader;
 
 /**

Modified: trunk/libavformat/rtspdec.c
==============================================================================
--- trunk/libavformat/rtspdec.c	Mon Nov 15 10:30:20 2010	(r25754)
+++ trunk/libavformat/rtspdec.c	Mon Nov 15 16:08:53 2010	(r25755)
@@ -105,6 +105,9 @@ int ff_rtsp_setup_input_streams(AVFormat
         av_freep(&content);
         return AVERROR_INVALIDDATA;
     }
+    if (reply->content_base[0])
+        av_strlcpy(rt->control_uri, reply->content_base,
+                   sizeof(rt->control_uri));
 
     av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", content);
     /* now we got the SDP description, we parse it */



More information about the ffmpeg-cvslog mailing list