[SCM] libav/experimental: Use the "server" RTSP field to detect whether the server that we're talking to is a Microsoft Windows Media Server (the field will be "WMServer/version"). See "[PATCH] RTSP-MS 3/15: Add Windows Media Server type" thread on mailinglist.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:34:48 UTC 2013


The following commit has been merged in the experimental branch:
commit 7a86bafa20aca6cdb38c425d23aa5aaf4271210a
Author: Ronald S. Bultje <rsbultje at gmail.com>
Date:   Wed Jan 7 14:55:47 2009 +0000

    Use the "server" RTSP field to detect whether the server that we're talking
    to is a Microsoft Windows Media Server (the field will be "WMServer/version").
    See "[PATCH] RTSP-MS 3/15: Add Windows Media Server type" thread on
    mailinglist.
    
    Originally committed as revision 16472 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 2ba1755..26bae08 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -688,6 +688,9 @@ void rtsp_parse_line(RTSPHeader *reply, const char *buf)
     } else if (av_stristart(p, "RealChallenge1:", &p)) {
         skip_spaces(&p);
         av_strlcpy(reply->real_challenge, p, sizeof(reply->real_challenge));
+    } else if (av_stristart(p, "Server:", &p)) {
+        skip_spaces(&p);
+        av_strlcpy(reply->server, p, sizeof(reply->server));
     }
 }
 
@@ -1123,6 +1126,8 @@ static int rtsp_read_header(AVFormatContext *s,
         if (rt->server_type != RTSP_SERVER_REAL && reply->real_challenge[0]) {
             rt->server_type = RTSP_SERVER_REAL;
             continue;
+        } else if (!strncasecmp(reply->server, "WMServer/", 9)) {
+            rt->server_type = RTSP_SERVER_WMS;
         } else if (rt->server_type == RTSP_SERVER_REAL) {
             strcpy(real_challenge, reply->real_challenge);
         }
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index 36297e9..ebc7ab7 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -66,6 +66,7 @@ typedef struct RTSPHeader {
     int seq; /**< sequence number */
     char session_id[512];
     char real_challenge[64]; /**< the RealChallenge1 field from the server */
+    char server[64];
 } RTSPHeader;
 
 enum RTSPClientState {
@@ -77,6 +78,7 @@ enum RTSPClientState {
 enum RTSPServerType {
     RTSP_SERVER_RTP,  /*< Standard-compliant RTP-server */
     RTSP_SERVER_REAL, /*< Realmedia-style server */
+    RTSP_SERVER_WMS,  /*< Windows Media server */
     RTSP_SERVER_LAST
 };
 

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list