rtsp: Include an User-Agent header field in all requests
authorMartin Storsjö <martin@martin.st>
Fri, 12 Jul 2013 09:14:12 +0000 (12:14 +0300)
committerMartin Storsjö <martin@martin.st>
Sun, 14 Jul 2013 17:53:04 +0000 (20:53 +0300)
Some rtsp servers like the IP Cam IcyBox IB-CAM2002 need it.

Based on a patch by Carl Eugen Hoyos.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtsp.c

index 761aa11..29ef403 100644 (file)
@@ -1133,6 +1133,7 @@ static int rtsp_send_cmd_with_content_async(AVFormatContext *s,
     if (headers)
         av_strlcat(buf, headers, sizeof(buf));
     av_strlcatf(buf, sizeof(buf), "CSeq: %d\r\n", rt->seq);
+    av_strlcatf(buf, sizeof(buf), "User-Agent: %s\r\n", LIBAVFORMAT_IDENT);
     if (rt->session_id[0] != '\0' && (!headers ||
         !strstr(headers, "\nIf-Match:"))) {
         av_strlcatf(buf, sizeof(buf), "Session: %s\r\n", rt->session_id);