From 96949dafcca87f65902bd77a0bc56007d9cead70 Mon Sep 17 00:00:00 2001 From: Reimar Döffinger Date: Wed, 2 Nov 2011 20:17:25 +0100 Subject: Replace all strcasecmp/strncasecmp usages. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All current usages of it are incompatible with localization. For example strcasecmp("i", "I") != 0 is possible, but would break many of the places where it is used. Instead use our own implementations that always treat the data as ASCII. Signed-off-by: Reimar Döffinger --- libavformat/rtsp.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'libavformat/rtsp.c') diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index a80a9da7bf..5966e813b7 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -33,7 +33,6 @@ #if HAVE_POLL_H #include #endif -#include #include "internal.h" #include "network.h" #include "os_support.h" @@ -660,7 +659,7 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p) get_word_sep(transport_protocol, sizeof(transport_protocol), "/", &p); - if (!strcasecmp (transport_protocol, "rtp")) { + if (!av_strcasecmp (transport_protocol, "rtp")) { get_word_sep(profile, sizeof(profile), "/;,", &p); lower_transport[0] = '\0'; /* rtp/avp/ */ @@ -669,14 +668,14 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p) ";,", &p); } th->transport = RTSP_TRANSPORT_RTP; - } else if (!strcasecmp (transport_protocol, "x-pn-tng") || - !strcasecmp (transport_protocol, "x-real-rdt")) { + } else if (!av_strcasecmp (transport_protocol, "x-pn-tng") || + !av_strcasecmp (transport_protocol, "x-real-rdt")) { /* x-pn-tng/ */ get_word_sep(lower_transport, sizeof(lower_transport), "/;,", &p); profile[0] = '\0'; th->transport = RTSP_TRANSPORT_RDT; } - if (!strcasecmp(lower_transport, "TCP")) + if (!av_strcasecmp(lower_transport, "TCP")) th->lower_transport = RTSP_LOWER_TRANSPORT_TCP; else th->lower_transport = RTSP_LOWER_TRANSPORT_UDP; @@ -1555,7 +1554,7 @@ redirect: 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)) { + } else if (!av_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); -- cgit v1.2.3