[FFmpeg-cvslog] rtsp: Add content-type message header parsing

Jordi Ortiz git at videolan.org
Thu May 10 02:33:17 CEST 2012


ffmpeg | branch: master | Jordi Ortiz <nenjordi at gmail.com> | Fri May  4 17:50:31 2012 +0200| [fcd0298c05c28429ef8508c924288131c87830b5] | committer: Luca Barbato

rtsp: Add content-type message header parsing

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fcd0298c05c28429ef8508c924288131c87830b5
---

 libavformat/rtsp.c |    3 +++
 libavformat/rtsp.h |    5 +++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 2ad2c4d..31eb4be 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -870,6 +870,9 @@ void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,
     } else if (av_stristart(p, "x-Accept-Dynamic-Rate:", &p) && rt) {
         p += strspn(p, SPACE_CHARS);
         rt->accept_dynamic_rate = atoi(p);
+    } else if (av_stristart(p, "Content-Type:", &p)) {
+        p += strspn(p, SPACE_CHARS);
+        av_strlcpy(reply->content_type, p, sizeof(reply->content_type));
     }
 }
 
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index 6872a51..e512336 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -171,6 +171,11 @@ typedef struct RTSPMessageHeader {
      * returned
      */
     char reason[256];
+
+    /**
+     * Content type header
+     */
+    char content_type[64];
 } RTSPMessageHeader;
 
 /**



More information about the ffmpeg-cvslog mailing list