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

mstorsjo subversion
Sun Jan 2 11:11:12 CET 2011


Author: mstorsjo
Date: Sun Jan  2 11:11:12 2011
New Revision: 26192

Log:
rtsp: Store the Content-Base header value straight to the target

This avoids having a large temporary buffer in the struct used for
storing the rtsp reply headers.

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

Modified: trunk/libavformat/rtsp.c
==============================================================================
--- trunk/libavformat/rtsp.c	Sun Jan  2 11:10:12 2011	(r26191)
+++ trunk/libavformat/rtsp.c	Sun Jan  2 11:11:12 2011	(r26192)
@@ -724,9 +724,10 @@ void ff_rtsp_parse_line(RTSPMessageHeade
     } else if (av_stristart(p, "Authentication-Info:", &p) && rt) {
         p += strspn(p, SPACE_CHARS);
         ff_http_auth_handle_header(&rt->auth_state, "Authentication-Info", p);
-    } else if (av_stristart(p, "Content-Base:", &p)) {
+    } else if (av_stristart(p, "Content-Base:", &p) && rt) {
         p += strspn(p, SPACE_CHARS);
-        av_strlcpy(reply->content_base, p , sizeof(reply->content_base));
+        if (method && !strcmp(method, "DESCRIBE"))
+            av_strlcpy(rt->control_uri, p , sizeof(rt->control_uri));
     }
 }
 

Modified: trunk/libavformat/rtsp.h
==============================================================================
--- trunk/libavformat/rtsp.h	Sun Jan  2 11:10:12 2011	(r26191)
+++ trunk/libavformat/rtsp.h	Sun Jan  2 11:11:12 2011	(r26192)
@@ -165,10 +165,6 @@ 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	Sun Jan  2 11:10:12 2011	(r26191)
+++ trunk/libavformat/rtspdec.c	Sun Jan  2 11:11:12 2011	(r26192)
@@ -107,9 +107,6 @@ 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