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.
Showing the changes to avserver.c (1 of 14 files). Show all
Unified · Split
| @@ -24,7 +24,6 @@ · 23 unmodified lines | ||
| 24 | 24 | #define closesocket close |
| 25 | 25 | #endif |
| 26 | 26 | #include <string.h> |
| 27 | −#include <strings.h> | |
| 28 | 27 | #include <stdlib.h> |
| 29 | 28 | #include "libavformat/avformat.h" |
| 30 | 29 | #include "libavformat/ffm.h" |
| @@ -1085,13 +1084,13 @@ static int extract_rates(char *rates, int ratelen, const char *request) · 1054 unmodified lines | ||
| 1085 | 1084 | const char *p; |
| 1086 | 1085 | |
| 1087 | 1086 | for (p = request; *p && *p != '\r' && *p != '\n'; ) { |
| 1088 | − if (strncasecmp(p, "Pragma:", 7) == 0) { | |
| 1087 | + if (av_strncasecmp(p, "Pragma:", 7) == 0) { | |
| 1089 | 1088 | const char *q = p + 7; |
| 1090 | 1089 | |
| 1091 | 1090 | while (*q && *q != '\n' && isspace(*q)) |
| 1092 | 1091 | q++; |
| 1093 | 1092 | |
| 1094 | − if (strncasecmp(q, "stream-switch-entry=", 20) == 0) { | |
| 1093 | + if (av_strncasecmp(q, "stream-switch-entry=", 20) == 0) { | |
| 1095 | 1094 | int stream_no; |
| 1096 | 1095 | int rate_no; |
| 1097 | 1096 | |
| @@ -1271,9 +1270,9 @@ static void parse_acl_row(FFStream *stream, FFStream* feed, IPAddressACL *ext_ac · 173 unmodified lines | ||
| 1271 | 1270 | int errors = 0; |
| 1272 | 1271 | |
| 1273 | 1272 | get_arg(arg, sizeof(arg), &p); |
| 1274 | − if (strcasecmp(arg, "allow") == 0) | |
| 1273 | + if (av_strcasecmp(arg, "allow") == 0) | |
| 1275 | 1274 | acl.action = IP_ALLOW; |
| 1276 | − else if (strcasecmp(arg, "deny") == 0) | |
| 1275 | + else if (av_strcasecmp(arg, "deny") == 0) | |
| 1277 | 1276 | acl.action = IP_DENY; |
| 1278 | 1277 | else { |
| 1279 | 1278 | 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 | ||
| 1358 | 1357 | continue; |
| 1359 | 1358 | get_arg(cmd, sizeof(cmd), &p); |
| 1360 | 1359 | |
| 1361 | − if (!strcasecmp(cmd, "ACL")) | |
| 1360 | + if (!av_strcasecmp(cmd, "ACL")) | |
| 1362 | 1361 | parse_acl_row(NULL, NULL, acl, p, stream->dynamic_acl, line_num); |
| 1363 | 1362 | } |
| 1364 | 1363 | fclose(f); |
| @@ -1500,7 +1499,7 @@ static int http_parse_request(HTTPContext *c) · 135 unmodified lines | ||
| 1500 | 1499 | av_strlcpy(filename, url + ((*url == '/') ? 1 : 0), sizeof(filename)-1); |
| 1501 | 1500 | |
| 1502 | 1501 | 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) { | |
| 1504 | 1503 | useragent = p + 11; |
| 1505 | 1504 | if (*useragent && *useragent != '\n' && isspace(*useragent)) |
| 1506 | 1505 | useragent++; |
| @@ -1518,7 +1517,7 @@ static int http_parse_request(HTTPContext *c) · 11 unmodified lines | ||
| 1518 | 1517 | redir_type = REDIR_ASX; |
| 1519 | 1518 | filename[strlen(filename)-1] = 'f'; |
| 1520 | 1519 | } else if (av_match_ext(filename, "asf") && |
| 1521 | − (!useragent || strncasecmp(useragent, "NSPlayer", 8) != 0)) { | |
| 1520 | + (!useragent || av_strncasecmp(useragent, "NSPlayer", 8) != 0)) { | |
| 1522 | 1521 | /* if this isn't WMP or lookalike, return the redirector file */ |
| 1523 | 1522 | redir_type = REDIR_ASF; |
| 1524 | 1523 | } else if (av_match_ext(filename, "rpm,ram")) { |
| @@ -1613,7 +1612,7 @@ static int http_parse_request(HTTPContext *c) · 88 unmodified lines | ||
| 1613 | 1612 | char *hostinfo = 0; |
| 1614 | 1613 | |
| 1615 | 1614 | for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) { |
| 1616 | − if (strncasecmp(p, "Host:", 5) == 0) { | |
| 1615 | + if (av_strncasecmp(p, "Host:", 5) == 0) { | |
| 1617 | 1616 | hostinfo = p + 5; |
| 1618 | 1617 | break; |
| 1619 | 1618 | } |
| @@ -1742,11 +1741,11 @@ static int http_parse_request(HTTPContext *c) · 122 unmodified lines | ||
| 1742 | 1741 | int client_id = 0; |
| 1743 | 1742 | |
| 1744 | 1743 | 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) { | |
| 1746 | 1745 | logline = p; |
| 1747 | 1746 | break; |
| 1748 | 1747 | } |
| 1749 | − if (strncasecmp(p, "Pragma: client-id=", 18) == 0) | |
| 1748 | + if (av_strncasecmp(p, "Pragma: client-id=", 18) == 0) | |
| 1750 | 1749 | client_id = strtol(p + 18, 0, 10); |
| 1751 | 1750 | p = strchr(p, '\n'); |
| 1752 | 1751 | if (!p) |
| @@ -4059,40 +4058,40 @@ static int parse_ffconfig(const char *filename) · 2306 unmodified lines | ||
| 4059 | 4058 | |
| 4060 | 4059 | get_arg(cmd, sizeof(cmd), &p); |
| 4061 | 4060 | |
| 4062 | − if (!strcasecmp(cmd, "Port")) { | |
| 4061 | + if (!av_strcasecmp(cmd, "Port")) { | |
| 4063 | 4062 | get_arg(arg, sizeof(arg), &p); |
| 4064 | 4063 | val = atoi(arg); |
| 4065 | 4064 | if (val < 1 || val > 65536) { |
| 4066 | 4065 | ERROR("Invalid_port: %s\n", arg); |
| 4067 | 4066 | } |
| 4068 | 4067 | my_http_addr.sin_port = htons(val); |
| 4069 | − } else if (!strcasecmp(cmd, "BindAddress")) { | |
| 4068 | + } else if (!av_strcasecmp(cmd, "BindAddress")) { | |
| 4070 | 4069 | get_arg(arg, sizeof(arg), &p); |
| 4071 | 4070 | if (resolve_host(&my_http_addr.sin_addr, arg) != 0) { |
| 4072 | 4071 | ERROR("%s:%d: Invalid host/IP address: %s\n", arg); |
| 4073 | 4072 | } |
| 4074 | − } else if (!strcasecmp(cmd, "NoDaemon")) { | |
| 4073 | + } else if (!av_strcasecmp(cmd, "NoDaemon")) { | |
| 4075 | 4074 | avserver_daemon = 0; |
| 4076 | − } else if (!strcasecmp(cmd, "RTSPPort")) { | |
| 4075 | + } else if (!av_strcasecmp(cmd, "RTSPPort")) { | |
| 4077 | 4076 | get_arg(arg, sizeof(arg), &p); |
| 4078 | 4077 | val = atoi(arg); |
| 4079 | 4078 | if (val < 1 || val > 65536) { |
| 4080 | 4079 | ERROR("%s:%d: Invalid port: %s\n", arg); |
| 4081 | 4080 | } |
| 4082 | 4081 | my_rtsp_addr.sin_port = htons(atoi(arg)); |
| 4083 | − } else if (!strcasecmp(cmd, "RTSPBindAddress")) { | |
| 4082 | + } else if (!av_strcasecmp(cmd, "RTSPBindAddress")) { | |
| 4084 | 4083 | get_arg(arg, sizeof(arg), &p); |
| 4085 | 4084 | if (resolve_host(&my_rtsp_addr.sin_addr, arg) != 0) { |
| 4086 | 4085 | ERROR("Invalid host/IP address: %s\n", arg); |
| 4087 | 4086 | } |
| 4088 | − } else if (!strcasecmp(cmd, "MaxHTTPConnections")) { | |
| 4087 | + } else if (!av_strcasecmp(cmd, "MaxHTTPConnections")) { | |
| 4089 | 4088 | get_arg(arg, sizeof(arg), &p); |
| 4090 | 4089 | val = atoi(arg); |
| 4091 | 4090 | if (val < 1 || val > 65536) { |
| 4092 | 4091 | ERROR("Invalid MaxHTTPConnections: %s\n", arg); |
| 4093 | 4092 | } |
| 4094 | 4093 | nb_max_http_connections = val; |
| 4095 | − } else if (!strcasecmp(cmd, "MaxClients")) { | |
| 4094 | + } else if (!av_strcasecmp(cmd, "MaxClients")) { | |
| 4096 | 4095 | get_arg(arg, sizeof(arg), &p); |
| 4097 | 4096 | val = atoi(arg); |
| 4098 | 4097 | if (val < 1 || val > nb_max_http_connections) { |
| @@ -4100,7 +4099,7 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line | ||
| 4100 | 4099 | } else { |
| 4101 | 4100 | nb_max_connections = val; |
| 4102 | 4101 | } |
| 4103 | − } else if (!strcasecmp(cmd, "MaxBandwidth")) { | |
| 4102 | + } else if (!av_strcasecmp(cmd, "MaxBandwidth")) { | |
| 4104 | 4103 | int64_t llval; |
| 4105 | 4104 | get_arg(arg, sizeof(arg), &p); |
| 4106 | 4105 | llval = atoll(arg); |
| @@ -4108,10 +4107,10 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line | ||
| 4108 | 4107 | ERROR("Invalid MaxBandwidth: %s\n", arg); |
| 4109 | 4108 | } else |
| 4110 | 4109 | max_bandwidth = llval; |
| 4111 | − } else if (!strcasecmp(cmd, "CustomLog")) { | |
| 4110 | + } else if (!av_strcasecmp(cmd, "CustomLog")) { | |
| 4112 | 4111 | if (!avserver_debug) |
| 4113 | 4112 | get_arg(logfilename, sizeof(logfilename), &p); |
| 4114 | − } else if (!strcasecmp(cmd, "<Feed")) { | |
| 4113 | + } else if (!av_strcasecmp(cmd, "<Feed")) { | |
| 4115 | 4114 | /*********************************************/ |
| 4116 | 4115 | /* Feed related options */ |
| 4117 | 4116 | char *q; |
| @@ -4145,7 +4144,7 @@ static int parse_ffconfig(const char *filename) · 27 unmodified lines | ||
| 4145 | 4144 | *last_feed = feed; |
| 4146 | 4145 | last_feed = &feed->next_feed; |
| 4147 | 4146 | } |
| 4148 | − } else if (!strcasecmp(cmd, "Launch")) { | |
| 4147 | + } else if (!av_strcasecmp(cmd, "Launch")) { | |
| 4149 | 4148 | if (feed) { |
| 4150 | 4149 | int i; |
| 4151 | 4150 | |
| @@ -4167,24 +4166,24 @@ static int parse_ffconfig(const char *filename) · 15 unmodified lines | ||
| 4167 | 4166 | inet_ntoa(my_http_addr.sin_addr), |
| 4168 | 4167 | ntohs(my_http_addr.sin_port), feed->filename); |
| 4169 | 4168 | } |
| 4170 | − } else if (!strcasecmp(cmd, "ReadOnlyFile")) { | |
| 4169 | + } else if (!av_strcasecmp(cmd, "ReadOnlyFile")) { | |
| 4171 | 4170 | if (feed) { |
| 4172 | 4171 | get_arg(feed->feed_filename, sizeof(feed->feed_filename), &p); |
| 4173 | 4172 | feed->readonly = 1; |
| 4174 | 4173 | } else if (stream) { |
| 4175 | 4174 | get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p); |
| 4176 | 4175 | } |
| 4177 | − } else if (!strcasecmp(cmd, "File")) { | |
| 4176 | + } else if (!av_strcasecmp(cmd, "File")) { | |
| 4178 | 4177 | if (feed) { |
| 4179 | 4178 | get_arg(feed->feed_filename, sizeof(feed->feed_filename), &p); |
| 4180 | 4179 | } else if (stream) |
| 4181 | 4180 | get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p); |
| 4182 | − } else if (!strcasecmp(cmd, "Truncate")) { | |
| 4181 | + } else if (!av_strcasecmp(cmd, "Truncate")) { | |
| 4183 | 4182 | if (feed) { |
| 4184 | 4183 | get_arg(arg, sizeof(arg), &p); |
| 4185 | 4184 | feed->truncate = strtod(arg, NULL); |
| 4186 | 4185 | } |
| 4187 | − } else if (!strcasecmp(cmd, "FileMaxSize")) { | |
| 4186 | + } else if (!av_strcasecmp(cmd, "FileMaxSize")) { | |
| 4188 | 4187 | if (feed) { |
| 4189 | 4188 | char *p1; |
| 4190 | 4189 | double fsize; |
| @@ -4208,12 +4207,12 @@ static int parse_ffconfig(const char *filename) · 17 unmodified lines | ||
| 4208 | 4207 | ERROR("Feed max file size is too small, must be at least %d\n", FFM_PACKET_SIZE*4); |
| 4209 | 4208 | } |
| 4210 | 4209 | } |
| 4211 | − } else if (!strcasecmp(cmd, "</Feed>")) { | |
| 4210 | + } else if (!av_strcasecmp(cmd, "</Feed>")) { | |
| 4212 | 4211 | if (!feed) { |
| 4213 | 4212 | ERROR("No corresponding <Feed> for </Feed>\n"); |
| 4214 | 4213 | } |
| 4215 | 4214 | feed = NULL; |
| 4216 | − } else if (!strcasecmp(cmd, "<Stream")) { | |
| 4215 | + } else if (!av_strcasecmp(cmd, "<Stream")) { | |
| 4217 | 4216 | /*********************************************/ |
| 4218 | 4217 | /* Stream related options */ |
| 4219 | 4218 | char *q; |
| @@ -4246,7 +4245,7 @@ static int parse_ffconfig(const char *filename) · 26 unmodified lines | ||
| 4246 | 4245 | *last_stream = stream; |
| 4247 | 4246 | last_stream = &stream->next; |
| 4248 | 4247 | } |
| 4249 | − } else if (!strcasecmp(cmd, "Feed")) { | |
| 4248 | + } else if (!av_strcasecmp(cmd, "Feed")) { | |
| 4250 | 4249 | get_arg(arg, sizeof(arg), &p); |
| 4251 | 4250 | if (stream) { |
| 4252 | 4251 | FFStream *sfeed; |
| @@ -4262,7 +4261,7 @@ static int parse_ffconfig(const char *filename) · 9 unmodified lines | ||
| 4262 | 4261 | else |
| 4263 | 4262 | stream->feed = sfeed; |
| 4264 | 4263 | } |
| 4265 | − } else if (!strcasecmp(cmd, "Format")) { | |
| 4264 | + } else if (!av_strcasecmp(cmd, "Format")) { | |
| 4266 | 4265 | get_arg(arg, sizeof(arg), &p); |
| 4267 | 4266 | if (stream) { |
| 4268 | 4267 | if (!strcmp(arg, "status")) { |
| @@ -4283,7 +4282,7 @@ static int parse_ffconfig(const char *filename) · 14 unmodified lines | ||
| 4283 | 4282 | video_id = stream->fmt->video_codec; |
| 4284 | 4283 | } |
| 4285 | 4284 | } |
| 4286 | − } else if (!strcasecmp(cmd, "InputFormat")) { | |
| 4285 | + } else if (!av_strcasecmp(cmd, "InputFormat")) { | |
| 4287 | 4286 | get_arg(arg, sizeof(arg), &p); |
| 4288 | 4287 | if (stream) { |
| 4289 | 4288 | stream->ifmt = av_find_input_format(arg); |
| @@ -4291,65 +4290,65 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line | ||
| 4291 | 4290 | ERROR("Unknown input format: %s\n", arg); |
| 4292 | 4291 | } |
| 4293 | 4292 | } |
| 4294 | − } else if (!strcasecmp(cmd, "FaviconURL")) { | |
| 4293 | + } else if (!av_strcasecmp(cmd, "FaviconURL")) { | |
| 4295 | 4294 | if (stream && stream->stream_type == STREAM_TYPE_STATUS) { |
| 4296 | 4295 | get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p); |
| 4297 | 4296 | } else { |
| 4298 | 4297 | ERROR("FaviconURL only permitted for status streams\n"); |
| 4299 | 4298 | } |
| 4300 | − } else if (!strcasecmp(cmd, "Author")) { | |
| 4299 | + } else if (!av_strcasecmp(cmd, "Author")) { | |
| 4301 | 4300 | if (stream) |
| 4302 | 4301 | get_arg(stream->author, sizeof(stream->author), &p); |
| 4303 | − } else if (!strcasecmp(cmd, "Comment")) { | |
| 4302 | + } else if (!av_strcasecmp(cmd, "Comment")) { | |
| 4304 | 4303 | if (stream) |
| 4305 | 4304 | get_arg(stream->comment, sizeof(stream->comment), &p); |
| 4306 | − } else if (!strcasecmp(cmd, "Copyright")) { | |
| 4305 | + } else if (!av_strcasecmp(cmd, "Copyright")) { | |
| 4307 | 4306 | if (stream) |
| 4308 | 4307 | get_arg(stream->copyright, sizeof(stream->copyright), &p); |
| 4309 | − } else if (!strcasecmp(cmd, "Title")) { | |
| 4308 | + } else if (!av_strcasecmp(cmd, "Title")) { | |
| 4310 | 4309 | if (stream) |
| 4311 | 4310 | get_arg(stream->title, sizeof(stream->title), &p); |
| 4312 | − } else if (!strcasecmp(cmd, "Preroll")) { | |
| 4311 | + } else if (!av_strcasecmp(cmd, "Preroll")) { | |
| 4313 | 4312 | get_arg(arg, sizeof(arg), &p); |
| 4314 | 4313 | if (stream) |
| 4315 | 4314 | stream->prebuffer = atof(arg) * 1000; |
| 4316 | − } else if (!strcasecmp(cmd, "StartSendOnKey")) { | |
| 4315 | + } else if (!av_strcasecmp(cmd, "StartSendOnKey")) { | |
| 4317 | 4316 | if (stream) |
| 4318 | 4317 | stream->send_on_key = 1; |
| 4319 | − } else if (!strcasecmp(cmd, "AudioCodec")) { | |
| 4318 | + } else if (!av_strcasecmp(cmd, "AudioCodec")) { | |
| 4320 | 4319 | get_arg(arg, sizeof(arg), &p); |
| 4321 | 4320 | audio_id = opt_audio_codec(arg); |
| 4322 | 4321 | if (audio_id == CODEC_ID_NONE) { |
| 4323 | 4322 | ERROR("Unknown AudioCodec: %s\n", arg); |
| 4324 | 4323 | } |
| 4325 | − } else if (!strcasecmp(cmd, "VideoCodec")) { | |
| 4324 | + } else if (!av_strcasecmp(cmd, "VideoCodec")) { | |
| 4326 | 4325 | get_arg(arg, sizeof(arg), &p); |
| 4327 | 4326 | video_id = opt_video_codec(arg); |
| 4328 | 4327 | if (video_id == CODEC_ID_NONE) { |
| 4329 | 4328 | ERROR("Unknown VideoCodec: %s\n", arg); |
| 4330 | 4329 | } |
| 4331 | − } else if (!strcasecmp(cmd, "MaxTime")) { | |
| 4330 | + } else if (!av_strcasecmp(cmd, "MaxTime")) { | |
| 4332 | 4331 | get_arg(arg, sizeof(arg), &p); |
| 4333 | 4332 | if (stream) |
| 4334 | 4333 | stream->max_time = atof(arg) * 1000; |
| 4335 | − } else if (!strcasecmp(cmd, "AudioBitRate")) { | |
| 4334 | + } else if (!av_strcasecmp(cmd, "AudioBitRate")) { | |
| 4336 | 4335 | get_arg(arg, sizeof(arg), &p); |
| 4337 | 4336 | if (stream) |
| 4338 | 4337 | audio_enc.bit_rate = lrintf(atof(arg) * 1000); |
| 4339 | − } else if (!strcasecmp(cmd, "AudioChannels")) { | |
| 4338 | + } else if (!av_strcasecmp(cmd, "AudioChannels")) { | |
| 4340 | 4339 | get_arg(arg, sizeof(arg), &p); |
| 4341 | 4340 | if (stream) |
| 4342 | 4341 | audio_enc.channels = atoi(arg); |
| 4343 | − } else if (!strcasecmp(cmd, "AudioSampleRate")) { | |
| 4342 | + } else if (!av_strcasecmp(cmd, "AudioSampleRate")) { | |
| 4344 | 4343 | get_arg(arg, sizeof(arg), &p); |
| 4345 | 4344 | if (stream) |
| 4346 | 4345 | audio_enc.sample_rate = atoi(arg); |
| 4347 | − } else if (!strcasecmp(cmd, "AudioQuality")) { | |
| 4346 | + } else if (!av_strcasecmp(cmd, "AudioQuality")) { | |
| 4348 | 4347 | get_arg(arg, sizeof(arg), &p); |
| 4349 | 4348 | if (stream) { |
| 4350 | 4349 | // audio_enc.quality = atof(arg) * 1000; |
| 4351 | 4350 | } |
| 4352 | − } else if (!strcasecmp(cmd, "VideoBitRateRange")) { | |
| 4351 | + } else if (!av_strcasecmp(cmd, "VideoBitRateRange")) { | |
| 4353 | 4352 | if (stream) { |
| 4354 | 4353 | int minrate, maxrate; |
| 4355 | 4354 | |
| @@ -4362,32 +4361,32 @@ static int parse_ffconfig(const char *filename) · 6 unmodified lines | ||
| 4362 | 4361 | ERROR("Incorrect format for VideoBitRateRange -- should be <min>-<max>: %s\n", arg); |
| 4363 | 4362 | } |
| 4364 | 4363 | } |
| 4365 | − } else if (!strcasecmp(cmd, "Debug")) { | |
| 4364 | + } else if (!av_strcasecmp(cmd, "Debug")) { | |
| 4366 | 4365 | if (stream) { |
| 4367 | 4366 | get_arg(arg, sizeof(arg), &p); |
| 4368 | 4367 | video_enc.debug = strtol(arg,0,0); |
| 4369 | 4368 | } |
| 4370 | − } else if (!strcasecmp(cmd, "Strict")) { | |
| 4369 | + } else if (!av_strcasecmp(cmd, "Strict")) { | |
| 4371 | 4370 | if (stream) { |
| 4372 | 4371 | get_arg(arg, sizeof(arg), &p); |
| 4373 | 4372 | video_enc.strict_std_compliance = atoi(arg); |
| 4374 | 4373 | } |
| 4375 | − } else if (!strcasecmp(cmd, "VideoBufferSize")) { | |
| 4374 | + } else if (!av_strcasecmp(cmd, "VideoBufferSize")) { | |
| 4376 | 4375 | if (stream) { |
| 4377 | 4376 | get_arg(arg, sizeof(arg), &p); |
| 4378 | 4377 | video_enc.rc_buffer_size = atoi(arg) * 8*1024; |
| 4379 | 4378 | } |
| 4380 | − } else if (!strcasecmp(cmd, "VideoBitRateTolerance")) { | |
| 4379 | + } else if (!av_strcasecmp(cmd, "VideoBitRateTolerance")) { | |
| 4381 | 4380 | if (stream) { |
| 4382 | 4381 | get_arg(arg, sizeof(arg), &p); |
| 4383 | 4382 | video_enc.bit_rate_tolerance = atoi(arg) * 1000; |
| 4384 | 4383 | } |
| 4385 | − } else if (!strcasecmp(cmd, "VideoBitRate")) { | |
| 4384 | + } else if (!av_strcasecmp(cmd, "VideoBitRate")) { | |
| 4386 | 4385 | get_arg(arg, sizeof(arg), &p); |
| 4387 | 4386 | if (stream) { |
| 4388 | 4387 | video_enc.bit_rate = atoi(arg) * 1000; |
| 4389 | 4388 | } |
| 4390 | − } else if (!strcasecmp(cmd, "VideoSize")) { | |
| 4389 | + } else if (!av_strcasecmp(cmd, "VideoSize")) { | |
| 4391 | 4390 | get_arg(arg, sizeof(arg), &p); |
| 4392 | 4391 | if (stream) { |
| 4393 | 4392 | 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 | ||
| 4396 | 4395 | ERROR("Image size must be a multiple of 16\n"); |
| 4397 | 4396 | } |
| 4398 | 4397 | } |
| 4399 | − } else if (!strcasecmp(cmd, "VideoFrameRate")) { | |
| 4398 | + } else if (!av_strcasecmp(cmd, "VideoFrameRate")) { | |
| 4400 | 4399 | get_arg(arg, sizeof(arg), &p); |
| 4401 | 4400 | if (stream) { |
| 4402 | 4401 | AVRational frame_rate; |
| @@ -4407,29 +4406,29 @@ static int parse_ffconfig(const char *filename) · 4 unmodified lines | ||
| 4407 | 4406 | video_enc.time_base.den = frame_rate.num; |
| 4408 | 4407 | } |
| 4409 | 4408 | } |
| 4410 | − } else if (!strcasecmp(cmd, "VideoGopSize")) { | |
| 4409 | + } else if (!av_strcasecmp(cmd, "VideoGopSize")) { | |
| 4411 | 4410 | get_arg(arg, sizeof(arg), &p); |
| 4412 | 4411 | if (stream) |
| 4413 | 4412 | video_enc.gop_size = atoi(arg); |
| 4414 | − } else if (!strcasecmp(cmd, "VideoIntraOnly")) { | |
| 4413 | + } else if (!av_strcasecmp(cmd, "VideoIntraOnly")) { | |
| 4415 | 4414 | if (stream) |
| 4416 | 4415 | video_enc.gop_size = 1; |
| 4417 | − } else if (!strcasecmp(cmd, "VideoHighQuality")) { | |
| 4416 | + } else if (!av_strcasecmp(cmd, "VideoHighQuality")) { | |
| 4418 | 4417 | if (stream) |
| 4419 | 4418 | video_enc.mb_decision = FF_MB_DECISION_BITS; |
| 4420 | − } else if (!strcasecmp(cmd, "Video4MotionVector")) { | |
| 4419 | + } else if (!av_strcasecmp(cmd, "Video4MotionVector")) { | |
| 4421 | 4420 | if (stream) { |
| 4422 | 4421 | video_enc.mb_decision = FF_MB_DECISION_BITS; //FIXME remove |
| 4423 | 4422 | video_enc.flags |= CODEC_FLAG_4MV; |
| 4424 | 4423 | } |
| 4425 | − } else if (!strcasecmp(cmd, "AVOptionVideo") || | |
| 4426 | − !strcasecmp(cmd, "AVOptionAudio")) { | |
| 4424 | + } else if (!av_strcasecmp(cmd, "AVOptionVideo") || | |
| 4425 | + !av_strcasecmp(cmd, "AVOptionAudio")) { | |
| 4427 | 4426 | char arg2[1024]; |
| 4428 | 4427 | AVCodecContext *avctx; |
| 4429 | 4428 | int type; |
| 4430 | 4429 | get_arg(arg, sizeof(arg), &p); |
| 4431 | 4430 | get_arg(arg2, sizeof(arg2), &p); |
| 4432 | − if (!strcasecmp(cmd, "AVOptionVideo")) { | |
| 4431 | + if (!av_strcasecmp(cmd, "AVOptionVideo")) { | |
| 4433 | 4432 | avctx = &video_enc; |
| 4434 | 4433 | type = AV_OPT_FLAG_VIDEO_PARAM; |
| 4435 | 4434 | } else { |
| @@ -4439,12 +4438,12 @@ static int parse_ffconfig(const char *filename) · 3 unmodified lines | ||
| 4439 | 4438 | if (avserver_opt_default(arg, arg2, avctx, type|AV_OPT_FLAG_ENCODING_PARAM)) { |
| 4440 | 4439 | ERROR("AVOption error: %s %s\n", arg, arg2); |
| 4441 | 4440 | } |
| 4442 | − } else if (!strcasecmp(cmd, "AVPresetVideo") || | |
| 4443 | − !strcasecmp(cmd, "AVPresetAudio")) { | |
| 4441 | + } else if (!av_strcasecmp(cmd, "AVPresetVideo") || | |
| 4442 | + !av_strcasecmp(cmd, "AVPresetAudio")) { | |
| 4444 | 4443 | AVCodecContext *avctx; |
| 4445 | 4444 | int type; |
| 4446 | 4445 | get_arg(arg, sizeof(arg), &p); |
| 4447 | − if (!strcasecmp(cmd, "AVPresetVideo")) { | |
| 4446 | + if (!av_strcasecmp(cmd, "AVPresetVideo")) { | |
| 4448 | 4447 | avctx = &video_enc; |
| 4449 | 4448 | video_enc.codec_id = video_id; |
| 4450 | 4449 | type = AV_OPT_FLAG_VIDEO_PARAM; |
| @@ -4456,26 +4455,26 @@ static int parse_ffconfig(const char *filename) · 5 unmodified lines | ||
| 4456 | 4455 | if (avserver_opt_preset(arg, avctx, type|AV_OPT_FLAG_ENCODING_PARAM, &audio_id, &video_id)) { |
| 4457 | 4456 | ERROR("AVPreset error: %s\n", arg); |
| 4458 | 4457 | } |
| 4459 | − } else if (!strcasecmp(cmd, "VideoTag")) { | |
| 4458 | + } else if (!av_strcasecmp(cmd, "VideoTag")) { | |
| 4460 | 4459 | get_arg(arg, sizeof(arg), &p); |
| 4461 | 4460 | if ((strlen(arg) == 4) && stream) |
| 4462 | 4461 | 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")) { | |
| 4464 | 4463 | if (stream) |
| 4465 | 4464 | video_enc.flags |= CODEC_FLAG_BITEXACT; |
| 4466 | − } else if (!strcasecmp(cmd, "DctFastint")) { | |
| 4465 | + } else if (!av_strcasecmp(cmd, "DctFastint")) { | |
| 4467 | 4466 | if (stream) |
| 4468 | 4467 | video_enc.dct_algo = FF_DCT_FASTINT; |
| 4469 | − } else if (!strcasecmp(cmd, "IdctSimple")) { | |
| 4468 | + } else if (!av_strcasecmp(cmd, "IdctSimple")) { | |
| 4470 | 4469 | if (stream) |
| 4471 | 4470 | video_enc.idct_algo = FF_IDCT_SIMPLE; |
| 4472 | − } else if (!strcasecmp(cmd, "Qscale")) { | |
| 4471 | + } else if (!av_strcasecmp(cmd, "Qscale")) { | |
| 4473 | 4472 | get_arg(arg, sizeof(arg), &p); |
| 4474 | 4473 | if (stream) { |
| 4475 | 4474 | video_enc.flags |= CODEC_FLAG_QSCALE; |
| 4476 | 4475 | video_enc.global_quality = FF_QP2LAMBDA * atoi(arg); |
| 4477 | 4476 | } |
| 4478 | − } else if (!strcasecmp(cmd, "VideoQDiff")) { | |
| 4477 | + } else if (!av_strcasecmp(cmd, "VideoQDiff")) { | |
| 4479 | 4478 | get_arg(arg, sizeof(arg), &p); |
| 4480 | 4479 | if (stream) { |
| 4481 | 4480 | video_enc.max_qdiff = atoi(arg); |
| @@ -4483,7 +4482,7 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line | ||
| 4483 | 4482 | ERROR("VideoQDiff out of range\n"); |
| 4484 | 4483 | } |
| 4485 | 4484 | } |
| 4486 | − } else if (!strcasecmp(cmd, "VideoQMax")) { | |
| 4485 | + } else if (!av_strcasecmp(cmd, "VideoQMax")) { | |
| 4487 | 4486 | get_arg(arg, sizeof(arg), &p); |
| 4488 | 4487 | if (stream) { |
| 4489 | 4488 | video_enc.qmax = atoi(arg); |
| @@ -4491,7 +4490,7 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line | ||
| 4491 | 4490 | ERROR("VideoQMax out of range\n"); |
| 4492 | 4491 | } |
| 4493 | 4492 | } |
| 4494 | − } else if (!strcasecmp(cmd, "VideoQMin")) { | |
| 4493 | + } else if (!av_strcasecmp(cmd, "VideoQMin")) { | |
| 4495 | 4494 | get_arg(arg, sizeof(arg), &p); |
| 4496 | 4495 | if (stream) { |
| 4497 | 4496 | video_enc.qmin = atoi(arg); |
| @@ -4499,39 +4498,39 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line | ||
| 4499 | 4498 | ERROR("VideoQMin out of range\n"); |
| 4500 | 4499 | } |
| 4501 | 4500 | } |
| 4502 | − } else if (!strcasecmp(cmd, "LumaElim")) { | |
| 4501 | + } else if (!av_strcasecmp(cmd, "LumaElim")) { | |
| 4503 | 4502 | get_arg(arg, sizeof(arg), &p); |
| 4504 | 4503 | if (stream) |
| 4505 | 4504 | video_enc.luma_elim_threshold = atoi(arg); |
| 4506 | − } else if (!strcasecmp(cmd, "ChromaElim")) { | |
| 4505 | + } else if (!av_strcasecmp(cmd, "ChromaElim")) { | |
| 4507 | 4506 | get_arg(arg, sizeof(arg), &p); |
| 4508 | 4507 | if (stream) |
| 4509 | 4508 | video_enc.chroma_elim_threshold = atoi(arg); |
| 4510 | − } else if (!strcasecmp(cmd, "LumiMask")) { | |
| 4509 | + } else if (!av_strcasecmp(cmd, "LumiMask")) { | |
| 4511 | 4510 | get_arg(arg, sizeof(arg), &p); |
| 4512 | 4511 | if (stream) |
| 4513 | 4512 | video_enc.lumi_masking = atof(arg); |
| 4514 | − } else if (!strcasecmp(cmd, "DarkMask")) { | |
| 4513 | + } else if (!av_strcasecmp(cmd, "DarkMask")) { | |
| 4515 | 4514 | get_arg(arg, sizeof(arg), &p); |
| 4516 | 4515 | if (stream) |
| 4517 | 4516 | video_enc.dark_masking = atof(arg); |
| 4518 | − } else if (!strcasecmp(cmd, "NoVideo")) { | |
| 4517 | + } else if (!av_strcasecmp(cmd, "NoVideo")) { | |
| 4519 | 4518 | video_id = CODEC_ID_NONE; |
| 4520 | − } else if (!strcasecmp(cmd, "NoAudio")) { | |
| 4519 | + } else if (!av_strcasecmp(cmd, "NoAudio")) { | |
| 4521 | 4520 | audio_id = CODEC_ID_NONE; |
| 4522 | − } else if (!strcasecmp(cmd, "ACL")) { | |
| 4521 | + } else if (!av_strcasecmp(cmd, "ACL")) { | |
| 4523 | 4522 | parse_acl_row(stream, feed, NULL, p, filename, line_num); |
| 4524 | − } else if (!strcasecmp(cmd, "DynamicACL")) { | |
| 4523 | + } else if (!av_strcasecmp(cmd, "DynamicACL")) { | |
| 4525 | 4524 | if (stream) { |
| 4526 | 4525 | get_arg(stream->dynamic_acl, sizeof(stream->dynamic_acl), &p); |
| 4527 | 4526 | } |
| 4528 | − } else if (!strcasecmp(cmd, "RTSPOption")) { | |
| 4527 | + } else if (!av_strcasecmp(cmd, "RTSPOption")) { | |
| 4529 | 4528 | get_arg(arg, sizeof(arg), &p); |
| 4530 | 4529 | if (stream) { |
| 4531 | 4530 | av_freep(&stream->rtsp_option); |
| 4532 | 4531 | stream->rtsp_option = av_strdup(arg); |
| 4533 | 4532 | } |
| 4534 | − } else if (!strcasecmp(cmd, "MulticastAddress")) { | |
| 4533 | + } else if (!av_strcasecmp(cmd, "MulticastAddress")) { | |
| 4535 | 4534 | get_arg(arg, sizeof(arg), &p); |
| 4536 | 4535 | if (stream) { |
| 4537 | 4536 | if (resolve_host(&stream->multicast_ip, arg) != 0) { |
| @@ -4540,18 +4539,18 @@ static int parse_ffconfig(const char *filename) · 2 unmodified lines | ||
| 4540 | 4539 | stream->is_multicast = 1; |
| 4541 | 4540 | stream->loop = 1; /* default is looping */ |
| 4542 | 4541 | } |
| 4543 | − } else if (!strcasecmp(cmd, "MulticastPort")) { | |
| 4542 | + } else if (!av_strcasecmp(cmd, "MulticastPort")) { | |
| 4544 | 4543 | get_arg(arg, sizeof(arg), &p); |
| 4545 | 4544 | if (stream) |
| 4546 | 4545 | stream->multicast_port = atoi(arg); |
| 4547 | − } else if (!strcasecmp(cmd, "MulticastTTL")) { | |
| 4546 | + } else if (!av_strcasecmp(cmd, "MulticastTTL")) { | |
| 4548 | 4547 | get_arg(arg, sizeof(arg), &p); |
| 4549 | 4548 | if (stream) |
| 4550 | 4549 | stream->multicast_ttl = atoi(arg); |
| 4551 | − } else if (!strcasecmp(cmd, "NoLoop")) { | |
| 4550 | + } else if (!av_strcasecmp(cmd, "NoLoop")) { | |
| 4552 | 4551 | if (stream) |
| 4553 | 4552 | stream->loop = 0; |
| 4554 | − } else if (!strcasecmp(cmd, "</Stream>")) { | |
| 4553 | + } else if (!av_strcasecmp(cmd, "</Stream>")) { | |
| 4555 | 4554 | if (!stream) { |
| 4556 | 4555 | ERROR("No corresponding <Stream> for </Stream>\n"); |
| 4557 | 4556 | } else { |
| @@ -4569,7 +4568,7 @@ static int parse_ffconfig(const char *filename) · 11 unmodified lines | ||
| 4569 | 4568 | } |
| 4570 | 4569 | stream = NULL; |
| 4571 | 4570 | } |
| 4572 | − } else if (!strcasecmp(cmd, "<Redirect")) { | |
| 4571 | + } else if (!av_strcasecmp(cmd, "<Redirect")) { | |
| 4573 | 4572 | /*********************************************/ |
| 4574 | 4573 | char *q; |
| 4575 | 4574 | if (stream || feed || redirect) { |
| @@ -4585,10 +4584,10 @@ static int parse_ffconfig(const char *filename) · 9 unmodified lines | ||
| 4585 | 4584 | *q = '\0'; |
| 4586 | 4585 | redirect->stream_type = STREAM_TYPE_REDIRECT; |
| 4587 | 4586 | } |
| 4588 | − } else if (!strcasecmp(cmd, "URL")) { | |
| 4587 | + } else if (!av_strcasecmp(cmd, "URL")) { | |
| 4589 | 4588 | if (redirect) |
| 4590 | 4589 | get_arg(redirect->feed_filename, sizeof(redirect->feed_filename), &p); |
| 4591 | − } else if (!strcasecmp(cmd, "</Redirect>")) { | |
| 4590 | + } else if (!av_strcasecmp(cmd, "</Redirect>")) { | |
| 4592 | 4591 | if (!redirect) { |
| 4593 | 4592 | ERROR("No corresponding <Redirect> for </Redirect>\n"); |
| 4594 | 4593 | } else { |
| @@ -4597,7 +4596,7 @@ static int parse_ffconfig(const char *filename) · 2 unmodified lines | ||
| 4597 | 4596 | } |
| 4598 | 4597 | redirect = NULL; |
| 4599 | 4598 | } |
| 4600 | − } else if (!strcasecmp(cmd, "LoadModule")) { | |
| 4599 | + } else if (!av_strcasecmp(cmd, "LoadModule")) { | |
| 4601 | 4600 | get_arg(arg, sizeof(arg), &p); |
| 4602 | 4601 | #if HAVE_DLOPEN |
| 4603 | 4602 | load_module(arg); |