History

Replace all usage of strcasecmp/strncasecmp

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.

Reimar Döffinger committed 15 years ago

Commit bb3244d1 parent ba04ecf14 files · +123 −132Browse files

Showing the changes to avserver.c (1 of 14 files). Show all

Unified · Split

avserver.c+88−89
@@ -24,7 +24,6 @@ · 23 unmodified lines
2424 #define closesocket close
2525 #endif
2626 #include <string.h>
27−#include <strings.h>
2827 #include <stdlib.h>
2928 #include "libavformat/avformat.h"
3029 #include "libavformat/ffm.h"
@@ -1085,13 +1084,13 @@ static int extract_rates(char *rates, int ratelen, const char *request) · 1054 unmodified lines
10851084 const char *p;
10861085
10871086 for (p = request; *p && *p != '\r' && *p != '\n'; ) {
1088− if (strncasecmp(p, "Pragma:", 7) == 0) {
1087+ if (av_strncasecmp(p, "Pragma:", 7) == 0) {
10891088 const char *q = p + 7;
10901089
10911090 while (*q && *q != '\n' && isspace(*q))
10921091 q++;
10931092
1094− if (strncasecmp(q, "stream-switch-entry=", 20) == 0) {
1093+ if (av_strncasecmp(q, "stream-switch-entry=", 20) == 0) {
10951094 int stream_no;
10961095 int rate_no;
10971096
@@ -1271,9 +1270,9 @@ static void parse_acl_row(FFStream *stream, FFStream* feed, IPAddressACL *ext_ac · 173 unmodified lines
12711270 int errors = 0;
12721271
12731272 get_arg(arg, sizeof(arg), &p);
1274− if (strcasecmp(arg, "allow") == 0)
1273+ if (av_strcasecmp(arg, "allow") == 0)
12751274 acl.action = IP_ALLOW;
1276− else if (strcasecmp(arg, "deny") == 0)
1275+ else if (av_strcasecmp(arg, "deny") == 0)
12771276 acl.action = IP_DENY;
12781277 else {
12791278 fprintf(stderr, "%s:%d: ACL action '%s' is not ALLOW or DENY\n",
@@ -1358,7 +1357,7 @@ static IPAddressACL* parse_dynamic_acl(FFStream *stream, HTTPContext *c) · 78 unmodified lines
13581357 continue;
13591358 get_arg(cmd, sizeof(cmd), &p);
13601359
1361− if (!strcasecmp(cmd, "ACL"))
1360+ if (!av_strcasecmp(cmd, "ACL"))
13621361 parse_acl_row(NULL, NULL, acl, p, stream->dynamic_acl, line_num);
13631362 }
13641363 fclose(f);
@@ -1500,7 +1499,7 @@ static int http_parse_request(HTTPContext *c) · 135 unmodified lines
15001499 av_strlcpy(filename, url + ((*url == '/') ? 1 : 0), sizeof(filename)-1);
15011500
15021501 for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) {
1503− if (strncasecmp(p, "User-Agent:", 11) == 0) {
1502+ if (av_strncasecmp(p, "User-Agent:", 11) == 0) {
15041503 useragent = p + 11;
15051504 if (*useragent && *useragent != '\n' && isspace(*useragent))
15061505 useragent++;
@@ -1518,7 +1517,7 @@ static int http_parse_request(HTTPContext *c) · 11 unmodified lines
15181517 redir_type = REDIR_ASX;
15191518 filename[strlen(filename)-1] = 'f';
15201519 } else if (av_match_ext(filename, "asf") &&
1521− (!useragent || strncasecmp(useragent, "NSPlayer", 8) != 0)) {
1520+ (!useragent || av_strncasecmp(useragent, "NSPlayer", 8) != 0)) {
15221521 /* if this isn't WMP or lookalike, return the redirector file */
15231522 redir_type = REDIR_ASF;
15241523 } else if (av_match_ext(filename, "rpm,ram")) {
@@ -1613,7 +1612,7 @@ static int http_parse_request(HTTPContext *c) · 88 unmodified lines
16131612 char *hostinfo = 0;
16141613
16151614 for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) {
1616− if (strncasecmp(p, "Host:", 5) == 0) {
1615+ if (av_strncasecmp(p, "Host:", 5) == 0) {
16171616 hostinfo = p + 5;
16181617 break;
16191618 }
@@ -1742,11 +1741,11 @@ static int http_parse_request(HTTPContext *c) · 122 unmodified lines
17421741 int client_id = 0;
17431742
17441743 for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) {
1745− if (strncasecmp(p, "Pragma: log-line=", 17) == 0) {
1744+ if (av_strncasecmp(p, "Pragma: log-line=", 17) == 0) {
17461745 logline = p;
17471746 break;
17481747 }
1749− if (strncasecmp(p, "Pragma: client-id=", 18) == 0)
1748+ if (av_strncasecmp(p, "Pragma: client-id=", 18) == 0)
17501749 client_id = strtol(p + 18, 0, 10);
17511750 p = strchr(p, '\n');
17521751 if (!p)
@@ -4059,40 +4058,40 @@ static int parse_ffconfig(const char *filename) · 2306 unmodified lines
40594058
40604059 get_arg(cmd, sizeof(cmd), &p);
40614060
4062− if (!strcasecmp(cmd, "Port")) {
4061+ if (!av_strcasecmp(cmd, "Port")) {
40634062 get_arg(arg, sizeof(arg), &p);
40644063 val = atoi(arg);
40654064 if (val < 1 || val > 65536) {
40664065 ERROR("Invalid_port: %s\n", arg);
40674066 }
40684067 my_http_addr.sin_port = htons(val);
4069− } else if (!strcasecmp(cmd, "BindAddress")) {
4068+ } else if (!av_strcasecmp(cmd, "BindAddress")) {
40704069 get_arg(arg, sizeof(arg), &p);
40714070 if (resolve_host(&my_http_addr.sin_addr, arg) != 0) {
40724071 ERROR("%s:%d: Invalid host/IP address: %s\n", arg);
40734072 }
4074− } else if (!strcasecmp(cmd, "NoDaemon")) {
4073+ } else if (!av_strcasecmp(cmd, "NoDaemon")) {
40754074 avserver_daemon = 0;
4076− } else if (!strcasecmp(cmd, "RTSPPort")) {
4075+ } else if (!av_strcasecmp(cmd, "RTSPPort")) {
40774076 get_arg(arg, sizeof(arg), &p);
40784077 val = atoi(arg);
40794078 if (val < 1 || val > 65536) {
40804079 ERROR("%s:%d: Invalid port: %s\n", arg);
40814080 }
40824081 my_rtsp_addr.sin_port = htons(atoi(arg));
4083− } else if (!strcasecmp(cmd, "RTSPBindAddress")) {
4082+ } else if (!av_strcasecmp(cmd, "RTSPBindAddress")) {
40844083 get_arg(arg, sizeof(arg), &p);
40854084 if (resolve_host(&my_rtsp_addr.sin_addr, arg) != 0) {
40864085 ERROR("Invalid host/IP address: %s\n", arg);
40874086 }
4088− } else if (!strcasecmp(cmd, "MaxHTTPConnections")) {
4087+ } else if (!av_strcasecmp(cmd, "MaxHTTPConnections")) {
40894088 get_arg(arg, sizeof(arg), &p);
40904089 val = atoi(arg);
40914090 if (val < 1 || val > 65536) {
40924091 ERROR("Invalid MaxHTTPConnections: %s\n", arg);
40934092 }
40944093 nb_max_http_connections = val;
4095− } else if (!strcasecmp(cmd, "MaxClients")) {
4094+ } else if (!av_strcasecmp(cmd, "MaxClients")) {
40964095 get_arg(arg, sizeof(arg), &p);
40974096 val = atoi(arg);
40984097 if (val < 1 || val > nb_max_http_connections) {
@@ -4100,7 +4099,7 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line
41004099 } else {
41014100 nb_max_connections = val;
41024101 }
4103− } else if (!strcasecmp(cmd, "MaxBandwidth")) {
4102+ } else if (!av_strcasecmp(cmd, "MaxBandwidth")) {
41044103 int64_t llval;
41054104 get_arg(arg, sizeof(arg), &p);
41064105 llval = atoll(arg);
@@ -4108,10 +4107,10 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line
41084107 ERROR("Invalid MaxBandwidth: %s\n", arg);
41094108 } else
41104109 max_bandwidth = llval;
4111− } else if (!strcasecmp(cmd, "CustomLog")) {
4110+ } else if (!av_strcasecmp(cmd, "CustomLog")) {
41124111 if (!avserver_debug)
41134112 get_arg(logfilename, sizeof(logfilename), &p);
4114− } else if (!strcasecmp(cmd, "<Feed")) {
4113+ } else if (!av_strcasecmp(cmd, "<Feed")) {
41154114 /*********************************************/
41164115 /* Feed related options */
41174116 char *q;
@@ -4145,7 +4144,7 @@ static int parse_ffconfig(const char *filename) · 27 unmodified lines
41454144 *last_feed = feed;
41464145 last_feed = &feed->next_feed;
41474146 }
4148− } else if (!strcasecmp(cmd, "Launch")) {
4147+ } else if (!av_strcasecmp(cmd, "Launch")) {
41494148 if (feed) {
41504149 int i;
41514150
@@ -4167,24 +4166,24 @@ static int parse_ffconfig(const char *filename) · 15 unmodified lines
41674166 inet_ntoa(my_http_addr.sin_addr),
41684167 ntohs(my_http_addr.sin_port), feed->filename);
41694168 }
4170− } else if (!strcasecmp(cmd, "ReadOnlyFile")) {
4169+ } else if (!av_strcasecmp(cmd, "ReadOnlyFile")) {
41714170 if (feed) {
41724171 get_arg(feed->feed_filename, sizeof(feed->feed_filename), &p);
41734172 feed->readonly = 1;
41744173 } else if (stream) {
41754174 get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p);
41764175 }
4177− } else if (!strcasecmp(cmd, "File")) {
4176+ } else if (!av_strcasecmp(cmd, "File")) {
41784177 if (feed) {
41794178 get_arg(feed->feed_filename, sizeof(feed->feed_filename), &p);
41804179 } else if (stream)
41814180 get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p);
4182− } else if (!strcasecmp(cmd, "Truncate")) {
4181+ } else if (!av_strcasecmp(cmd, "Truncate")) {
41834182 if (feed) {
41844183 get_arg(arg, sizeof(arg), &p);
41854184 feed->truncate = strtod(arg, NULL);
41864185 }
4187− } else if (!strcasecmp(cmd, "FileMaxSize")) {
4186+ } else if (!av_strcasecmp(cmd, "FileMaxSize")) {
41884187 if (feed) {
41894188 char *p1;
41904189 double fsize;
@@ -4208,12 +4207,12 @@ static int parse_ffconfig(const char *filename) · 17 unmodified lines
42084207 ERROR("Feed max file size is too small, must be at least %d\n", FFM_PACKET_SIZE*4);
42094208 }
42104209 }
4211− } else if (!strcasecmp(cmd, "</Feed>")) {
4210+ } else if (!av_strcasecmp(cmd, "</Feed>")) {
42124211 if (!feed) {
42134212 ERROR("No corresponding <Feed> for </Feed>\n");
42144213 }
42154214 feed = NULL;
4216− } else if (!strcasecmp(cmd, "<Stream")) {
4215+ } else if (!av_strcasecmp(cmd, "<Stream")) {
42174216 /*********************************************/
42184217 /* Stream related options */
42194218 char *q;
@@ -4246,7 +4245,7 @@ static int parse_ffconfig(const char *filename) · 26 unmodified lines
42464245 *last_stream = stream;
42474246 last_stream = &stream->next;
42484247 }
4249− } else if (!strcasecmp(cmd, "Feed")) {
4248+ } else if (!av_strcasecmp(cmd, "Feed")) {
42504249 get_arg(arg, sizeof(arg), &p);
42514250 if (stream) {
42524251 FFStream *sfeed;
@@ -4262,7 +4261,7 @@ static int parse_ffconfig(const char *filename) · 9 unmodified lines
42624261 else
42634262 stream->feed = sfeed;
42644263 }
4265− } else if (!strcasecmp(cmd, "Format")) {
4264+ } else if (!av_strcasecmp(cmd, "Format")) {
42664265 get_arg(arg, sizeof(arg), &p);
42674266 if (stream) {
42684267 if (!strcmp(arg, "status")) {
@@ -4283,7 +4282,7 @@ static int parse_ffconfig(const char *filename) · 14 unmodified lines
42834282 video_id = stream->fmt->video_codec;
42844283 }
42854284 }
4286− } else if (!strcasecmp(cmd, "InputFormat")) {
4285+ } else if (!av_strcasecmp(cmd, "InputFormat")) {
42874286 get_arg(arg, sizeof(arg), &p);
42884287 if (stream) {
42894288 stream->ifmt = av_find_input_format(arg);
@@ -4291,65 +4290,65 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line
42914290 ERROR("Unknown input format: %s\n", arg);
42924291 }
42934292 }
4294− } else if (!strcasecmp(cmd, "FaviconURL")) {
4293+ } else if (!av_strcasecmp(cmd, "FaviconURL")) {
42954294 if (stream && stream->stream_type == STREAM_TYPE_STATUS) {
42964295 get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p);
42974296 } else {
42984297 ERROR("FaviconURL only permitted for status streams\n");
42994298 }
4300− } else if (!strcasecmp(cmd, "Author")) {
4299+ } else if (!av_strcasecmp(cmd, "Author")) {
43014300 if (stream)
43024301 get_arg(stream->author, sizeof(stream->author), &p);
4303− } else if (!strcasecmp(cmd, "Comment")) {
4302+ } else if (!av_strcasecmp(cmd, "Comment")) {
43044303 if (stream)
43054304 get_arg(stream->comment, sizeof(stream->comment), &p);
4306− } else if (!strcasecmp(cmd, "Copyright")) {
4305+ } else if (!av_strcasecmp(cmd, "Copyright")) {
43074306 if (stream)
43084307 get_arg(stream->copyright, sizeof(stream->copyright), &p);
4309− } else if (!strcasecmp(cmd, "Title")) {
4308+ } else if (!av_strcasecmp(cmd, "Title")) {
43104309 if (stream)
43114310 get_arg(stream->title, sizeof(stream->title), &p);
4312− } else if (!strcasecmp(cmd, "Preroll")) {
4311+ } else if (!av_strcasecmp(cmd, "Preroll")) {
43134312 get_arg(arg, sizeof(arg), &p);
43144313 if (stream)
43154314 stream->prebuffer = atof(arg) * 1000;
4316− } else if (!strcasecmp(cmd, "StartSendOnKey")) {
4315+ } else if (!av_strcasecmp(cmd, "StartSendOnKey")) {
43174316 if (stream)
43184317 stream->send_on_key = 1;
4319− } else if (!strcasecmp(cmd, "AudioCodec")) {
4318+ } else if (!av_strcasecmp(cmd, "AudioCodec")) {
43204319 get_arg(arg, sizeof(arg), &p);
43214320 audio_id = opt_audio_codec(arg);
43224321 if (audio_id == CODEC_ID_NONE) {
43234322 ERROR("Unknown AudioCodec: %s\n", arg);
43244323 }
4325− } else if (!strcasecmp(cmd, "VideoCodec")) {
4324+ } else if (!av_strcasecmp(cmd, "VideoCodec")) {
43264325 get_arg(arg, sizeof(arg), &p);
43274326 video_id = opt_video_codec(arg);
43284327 if (video_id == CODEC_ID_NONE) {
43294328 ERROR("Unknown VideoCodec: %s\n", arg);
43304329 }
4331− } else if (!strcasecmp(cmd, "MaxTime")) {
4330+ } else if (!av_strcasecmp(cmd, "MaxTime")) {
43324331 get_arg(arg, sizeof(arg), &p);
43334332 if (stream)
43344333 stream->max_time = atof(arg) * 1000;
4335− } else if (!strcasecmp(cmd, "AudioBitRate")) {
4334+ } else if (!av_strcasecmp(cmd, "AudioBitRate")) {
43364335 get_arg(arg, sizeof(arg), &p);
43374336 if (stream)
43384337 audio_enc.bit_rate = lrintf(atof(arg) * 1000);
4339− } else if (!strcasecmp(cmd, "AudioChannels")) {
4338+ } else if (!av_strcasecmp(cmd, "AudioChannels")) {
43404339 get_arg(arg, sizeof(arg), &p);
43414340 if (stream)
43424341 audio_enc.channels = atoi(arg);
4343− } else if (!strcasecmp(cmd, "AudioSampleRate")) {
4342+ } else if (!av_strcasecmp(cmd, "AudioSampleRate")) {
43444343 get_arg(arg, sizeof(arg), &p);
43454344 if (stream)
43464345 audio_enc.sample_rate = atoi(arg);
4347− } else if (!strcasecmp(cmd, "AudioQuality")) {
4346+ } else if (!av_strcasecmp(cmd, "AudioQuality")) {
43484347 get_arg(arg, sizeof(arg), &p);
43494348 if (stream) {
43504349 // audio_enc.quality = atof(arg) * 1000;
43514350 }
4352− } else if (!strcasecmp(cmd, "VideoBitRateRange")) {
4351+ } else if (!av_strcasecmp(cmd, "VideoBitRateRange")) {
43534352 if (stream) {
43544353 int minrate, maxrate;
43554354
@@ -4362,32 +4361,32 @@ static int parse_ffconfig(const char *filename) · 6 unmodified lines
43624361 ERROR("Incorrect format for VideoBitRateRange -- should be <min>-<max>: %s\n", arg);
43634362 }
43644363 }
4365− } else if (!strcasecmp(cmd, "Debug")) {
4364+ } else if (!av_strcasecmp(cmd, "Debug")) {
43664365 if (stream) {
43674366 get_arg(arg, sizeof(arg), &p);
43684367 video_enc.debug = strtol(arg,0,0);
43694368 }
4370− } else if (!strcasecmp(cmd, "Strict")) {
4369+ } else if (!av_strcasecmp(cmd, "Strict")) {
43714370 if (stream) {
43724371 get_arg(arg, sizeof(arg), &p);
43734372 video_enc.strict_std_compliance = atoi(arg);
43744373 }
4375− } else if (!strcasecmp(cmd, "VideoBufferSize")) {
4374+ } else if (!av_strcasecmp(cmd, "VideoBufferSize")) {
43764375 if (stream) {
43774376 get_arg(arg, sizeof(arg), &p);
43784377 video_enc.rc_buffer_size = atoi(arg) * 8*1024;
43794378 }
4380− } else if (!strcasecmp(cmd, "VideoBitRateTolerance")) {
4379+ } else if (!av_strcasecmp(cmd, "VideoBitRateTolerance")) {
43814380 if (stream) {
43824381 get_arg(arg, sizeof(arg), &p);
43834382 video_enc.bit_rate_tolerance = atoi(arg) * 1000;
43844383 }
4385− } else if (!strcasecmp(cmd, "VideoBitRate")) {
4384+ } else if (!av_strcasecmp(cmd, "VideoBitRate")) {
43864385 get_arg(arg, sizeof(arg), &p);
43874386 if (stream) {
43884387 video_enc.bit_rate = atoi(arg) * 1000;
43894388 }
4390− } else if (!strcasecmp(cmd, "VideoSize")) {
4389+ } else if (!av_strcasecmp(cmd, "VideoSize")) {
43914390 get_arg(arg, sizeof(arg), &p);
43924391 if (stream) {
43934392 av_parse_video_size(&video_enc.width, &video_enc.height, arg);
@@ -4396,7 +4395,7 @@ static int parse_ffconfig(const char *filename) · 2 unmodified lines
43964395 ERROR("Image size must be a multiple of 16\n");
43974396 }
43984397 }
4399− } else if (!strcasecmp(cmd, "VideoFrameRate")) {
4398+ } else if (!av_strcasecmp(cmd, "VideoFrameRate")) {
44004399 get_arg(arg, sizeof(arg), &p);
44014400 if (stream) {
44024401 AVRational frame_rate;
@@ -4407,29 +4406,29 @@ static int parse_ffconfig(const char *filename) · 4 unmodified lines
44074406 video_enc.time_base.den = frame_rate.num;
44084407 }
44094408 }
4410− } else if (!strcasecmp(cmd, "VideoGopSize")) {
4409+ } else if (!av_strcasecmp(cmd, "VideoGopSize")) {
44114410 get_arg(arg, sizeof(arg), &p);
44124411 if (stream)
44134412 video_enc.gop_size = atoi(arg);
4414− } else if (!strcasecmp(cmd, "VideoIntraOnly")) {
4413+ } else if (!av_strcasecmp(cmd, "VideoIntraOnly")) {
44154414 if (stream)
44164415 video_enc.gop_size = 1;
4417− } else if (!strcasecmp(cmd, "VideoHighQuality")) {
4416+ } else if (!av_strcasecmp(cmd, "VideoHighQuality")) {
44184417 if (stream)
44194418 video_enc.mb_decision = FF_MB_DECISION_BITS;
4420− } else if (!strcasecmp(cmd, "Video4MotionVector")) {
4419+ } else if (!av_strcasecmp(cmd, "Video4MotionVector")) {
44214420 if (stream) {
44224421 video_enc.mb_decision = FF_MB_DECISION_BITS; //FIXME remove
44234422 video_enc.flags |= CODEC_FLAG_4MV;
44244423 }
4425− } else if (!strcasecmp(cmd, "AVOptionVideo") ||
4426− !strcasecmp(cmd, "AVOptionAudio")) {
4424+ } else if (!av_strcasecmp(cmd, "AVOptionVideo") ||
4425+ !av_strcasecmp(cmd, "AVOptionAudio")) {
44274426 char arg2[1024];
44284427 AVCodecContext *avctx;
44294428 int type;
44304429 get_arg(arg, sizeof(arg), &p);
44314430 get_arg(arg2, sizeof(arg2), &p);
4432− if (!strcasecmp(cmd, "AVOptionVideo")) {
4431+ if (!av_strcasecmp(cmd, "AVOptionVideo")) {
44334432 avctx = &video_enc;
44344433 type = AV_OPT_FLAG_VIDEO_PARAM;
44354434 } else {
@@ -4439,12 +4438,12 @@ static int parse_ffconfig(const char *filename) · 3 unmodified lines
44394438 if (avserver_opt_default(arg, arg2, avctx, type|AV_OPT_FLAG_ENCODING_PARAM)) {
44404439 ERROR("AVOption error: %s %s\n", arg, arg2);
44414440 }
4442− } else if (!strcasecmp(cmd, "AVPresetVideo") ||
4443− !strcasecmp(cmd, "AVPresetAudio")) {
4441+ } else if (!av_strcasecmp(cmd, "AVPresetVideo") ||
4442+ !av_strcasecmp(cmd, "AVPresetAudio")) {
44444443 AVCodecContext *avctx;
44454444 int type;
44464445 get_arg(arg, sizeof(arg), &p);
4447− if (!strcasecmp(cmd, "AVPresetVideo")) {
4446+ if (!av_strcasecmp(cmd, "AVPresetVideo")) {
44484447 avctx = &video_enc;
44494448 video_enc.codec_id = video_id;
44504449 type = AV_OPT_FLAG_VIDEO_PARAM;
@@ -4456,26 +4455,26 @@ static int parse_ffconfig(const char *filename) · 5 unmodified lines
44564455 if (avserver_opt_preset(arg, avctx, type|AV_OPT_FLAG_ENCODING_PARAM, &audio_id, &video_id)) {
44574456 ERROR("AVPreset error: %s\n", arg);
44584457 }
4459− } else if (!strcasecmp(cmd, "VideoTag")) {
4458+ } else if (!av_strcasecmp(cmd, "VideoTag")) {
44604459 get_arg(arg, sizeof(arg), &p);
44614460 if ((strlen(arg) == 4) && stream)
44624461 video_enc.codec_tag = MKTAG(arg[0], arg[1], arg[2], arg[3]);
4463− } else if (!strcasecmp(cmd, "BitExact")) {
4462+ } else if (!av_strcasecmp(cmd, "BitExact")) {
44644463 if (stream)
44654464 video_enc.flags |= CODEC_FLAG_BITEXACT;
4466− } else if (!strcasecmp(cmd, "DctFastint")) {
4465+ } else if (!av_strcasecmp(cmd, "DctFastint")) {
44674466 if (stream)
44684467 video_enc.dct_algo = FF_DCT_FASTINT;
4469− } else if (!strcasecmp(cmd, "IdctSimple")) {
4468+ } else if (!av_strcasecmp(cmd, "IdctSimple")) {
44704469 if (stream)
44714470 video_enc.idct_algo = FF_IDCT_SIMPLE;
4472− } else if (!strcasecmp(cmd, "Qscale")) {
4471+ } else if (!av_strcasecmp(cmd, "Qscale")) {
44734472 get_arg(arg, sizeof(arg), &p);
44744473 if (stream) {
44754474 video_enc.flags |= CODEC_FLAG_QSCALE;
44764475 video_enc.global_quality = FF_QP2LAMBDA * atoi(arg);
44774476 }
4478− } else if (!strcasecmp(cmd, "VideoQDiff")) {
4477+ } else if (!av_strcasecmp(cmd, "VideoQDiff")) {
44794478 get_arg(arg, sizeof(arg), &p);
44804479 if (stream) {
44814480 video_enc.max_qdiff = atoi(arg);
@@ -4483,7 +4482,7 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line
44834482 ERROR("VideoQDiff out of range\n");
44844483 }
44854484 }
4486− } else if (!strcasecmp(cmd, "VideoQMax")) {
4485+ } else if (!av_strcasecmp(cmd, "VideoQMax")) {
44874486 get_arg(arg, sizeof(arg), &p);
44884487 if (stream) {
44894488 video_enc.qmax = atoi(arg);
@@ -4491,7 +4490,7 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line
44914490 ERROR("VideoQMax out of range\n");
44924491 }
44934492 }
4494− } else if (!strcasecmp(cmd, "VideoQMin")) {
4493+ } else if (!av_strcasecmp(cmd, "VideoQMin")) {
44954494 get_arg(arg, sizeof(arg), &p);
44964495 if (stream) {
44974496 video_enc.qmin = atoi(arg);
@@ -4499,39 +4498,39 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line
44994498 ERROR("VideoQMin out of range\n");
45004499 }
45014500 }
4502− } else if (!strcasecmp(cmd, "LumaElim")) {
4501+ } else if (!av_strcasecmp(cmd, "LumaElim")) {
45034502 get_arg(arg, sizeof(arg), &p);
45044503 if (stream)
45054504 video_enc.luma_elim_threshold = atoi(arg);
4506− } else if (!strcasecmp(cmd, "ChromaElim")) {
4505+ } else if (!av_strcasecmp(cmd, "ChromaElim")) {
45074506 get_arg(arg, sizeof(arg), &p);
45084507 if (stream)
45094508 video_enc.chroma_elim_threshold = atoi(arg);
4510− } else if (!strcasecmp(cmd, "LumiMask")) {
4509+ } else if (!av_strcasecmp(cmd, "LumiMask")) {
45114510 get_arg(arg, sizeof(arg), &p);
45124511 if (stream)
45134512 video_enc.lumi_masking = atof(arg);
4514− } else if (!strcasecmp(cmd, "DarkMask")) {
4513+ } else if (!av_strcasecmp(cmd, "DarkMask")) {
45154514 get_arg(arg, sizeof(arg), &p);
45164515 if (stream)
45174516 video_enc.dark_masking = atof(arg);
4518− } else if (!strcasecmp(cmd, "NoVideo")) {
4517+ } else if (!av_strcasecmp(cmd, "NoVideo")) {
45194518 video_id = CODEC_ID_NONE;
4520− } else if (!strcasecmp(cmd, "NoAudio")) {
4519+ } else if (!av_strcasecmp(cmd, "NoAudio")) {
45214520 audio_id = CODEC_ID_NONE;
4522− } else if (!strcasecmp(cmd, "ACL")) {
4521+ } else if (!av_strcasecmp(cmd, "ACL")) {
45234522 parse_acl_row(stream, feed, NULL, p, filename, line_num);
4524− } else if (!strcasecmp(cmd, "DynamicACL")) {
4523+ } else if (!av_strcasecmp(cmd, "DynamicACL")) {
45254524 if (stream) {
45264525 get_arg(stream->dynamic_acl, sizeof(stream->dynamic_acl), &p);
45274526 }
4528− } else if (!strcasecmp(cmd, "RTSPOption")) {
4527+ } else if (!av_strcasecmp(cmd, "RTSPOption")) {
45294528 get_arg(arg, sizeof(arg), &p);
45304529 if (stream) {
45314530 av_freep(&stream->rtsp_option);
45324531 stream->rtsp_option = av_strdup(arg);
45334532 }
4534− } else if (!strcasecmp(cmd, "MulticastAddress")) {
4533+ } else if (!av_strcasecmp(cmd, "MulticastAddress")) {
45354534 get_arg(arg, sizeof(arg), &p);
45364535 if (stream) {
45374536 if (resolve_host(&stream->multicast_ip, arg) != 0) {
@@ -4540,18 +4539,18 @@ static int parse_ffconfig(const char *filename) · 2 unmodified lines
45404539 stream->is_multicast = 1;
45414540 stream->loop = 1; /* default is looping */
45424541 }
4543− } else if (!strcasecmp(cmd, "MulticastPort")) {
4542+ } else if (!av_strcasecmp(cmd, "MulticastPort")) {
45444543 get_arg(arg, sizeof(arg), &p);
45454544 if (stream)
45464545 stream->multicast_port = atoi(arg);
4547− } else if (!strcasecmp(cmd, "MulticastTTL")) {
4546+ } else if (!av_strcasecmp(cmd, "MulticastTTL")) {
45484547 get_arg(arg, sizeof(arg), &p);
45494548 if (stream)
45504549 stream->multicast_ttl = atoi(arg);
4551− } else if (!strcasecmp(cmd, "NoLoop")) {
4550+ } else if (!av_strcasecmp(cmd, "NoLoop")) {
45524551 if (stream)
45534552 stream->loop = 0;
4554− } else if (!strcasecmp(cmd, "</Stream>")) {
4553+ } else if (!av_strcasecmp(cmd, "</Stream>")) {
45554554 if (!stream) {
45564555 ERROR("No corresponding <Stream> for </Stream>\n");
45574556 } else {
@@ -4569,7 +4568,7 @@ static int parse_ffconfig(const char *filename) · 11 unmodified lines
45694568 }
45704569 stream = NULL;
45714570 }
4572− } else if (!strcasecmp(cmd, "<Redirect")) {
4571+ } else if (!av_strcasecmp(cmd, "<Redirect")) {
45734572 /*********************************************/
45744573 char *q;
45754574 if (stream || feed || redirect) {
@@ -4585,10 +4584,10 @@ static int parse_ffconfig(const char *filename) · 9 unmodified lines
45854584 *q = '\0';
45864585 redirect->stream_type = STREAM_TYPE_REDIRECT;
45874586 }
4588− } else if (!strcasecmp(cmd, "URL")) {
4587+ } else if (!av_strcasecmp(cmd, "URL")) {
45894588 if (redirect)
45904589 get_arg(redirect->feed_filename, sizeof(redirect->feed_filename), &p);
4591− } else if (!strcasecmp(cmd, "</Redirect>")) {
4590+ } else if (!av_strcasecmp(cmd, "</Redirect>")) {
45924591 if (!redirect) {
45934592 ERROR("No corresponding <Redirect> for </Redirect>\n");
45944593 } else {
@@ -4597,7 +4596,7 @@ static int parse_ffconfig(const char *filename) · 2 unmodified lines
45974596 }
45984597 redirect = NULL;
45994598 }
4600− } else if (!strcasecmp(cmd, "LoadModule")) {
4599+ } else if (!av_strcasecmp(cmd, "LoadModule")) {
46014600 get_arg(arg, sizeof(arg), &p);
46024601 #if HAVE_DLOPEN
46034602 load_module(arg);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t