[SCM] libav/experimental: rtsp: Store the Content-Base header value straight to the target

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:21:16 UTC 2013


The following commit has been merged in the experimental branch:
commit d2995eb910151cb83259223c2af6c665949ae6d0
Author: Martin Storsjö <martin at martin.st>
Date:   Sun Jan 2 10:11:12 2011 +0000

    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.
    
    Originally committed as revision 26192 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 4ba5cef..431703e 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -724,9 +724,10 @@ void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,
     } 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));
     }
 }
 
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index 2680297..628ce37 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -165,10 +165,6 @@ typedef struct RTSPMessageHeader {
      * returned
      */
     char reason[256];
-
-    /** The "Content-Base:" field.
-     */
-    char content_base[4096];
 } RTSPMessageHeader;
 
 /**
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 2ebc515..13fa969 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -107,9 +107,6 @@ int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply)
         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 */

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list