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

Unified · Split

14 files
  1. avserver.c +88 −89
  2. libavdevice/v4l2.c +2 −2
  3. libavformat/avidec.c +2 −2
  4. libavformat/http.c +8 −9
  5. libavformat/img2.c +1 −2
  6. libavformat/matroskaenc.c +2 −2
  7. libavformat/metadata.c +3 −3
  8. libavformat/mp3enc.c +1 −2
  9. libavformat/nutdec.c +2 −3
  10. libavformat/rtpdec.c +2 −2
  11. libavformat/rtpdec_mpeg4.c +1 −2
  12. libavformat/rtsp.c +5 −6
  13. libavformat/utils.c +3 −4
  14. libavutil/parseutils.c +3 −4
avserver.c+88−89
@@ -24,7 +24,6 @@ · 23 unmodified lines
24#define closesocket close24#define closesocket close
25#endif25#endif
26#include <string.h>26#include <string.h>
27#include <strings.h>
28#include <stdlib.h>27#include <stdlib.h>
29#include "libavformat/avformat.h"28#include "libavformat/avformat.h"
30#include "libavformat/ffm.h"29#include "libavformat/ffm.h"
@@ -1085,13 +1084,13 @@ static int extract_rates(char *rates, int ratelen, const char *request) · 1054 unmodified lines
1085 const char *p;1084 const char *p;
1086 1085
1087 for (p = request; *p && *p != '\r' && *p != '\n'; ) {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 const char *q = p + 7;1088 const char *q = p + 7;
1090 1089
1091 while (*q && *q != '\n' && isspace(*q))1090 while (*q && *q != '\n' && isspace(*q))
1092 q++;1091 q++;
1093 1092
1094 if (strncasecmp(q, "stream-switch-entry=", 20) == 0) {1093 if (av_strncasecmp(q, "stream-switch-entry=", 20) == 0) {
1095 int stream_no;1094 int stream_no;
1096 int rate_no;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 int errors = 0;1270 int errors = 0;
1272 1271
1273 get_arg(arg, sizeof(arg), &p);1272 get_arg(arg, sizeof(arg), &p);
1274 if (strcasecmp(arg, "allow") == 0)1273 if (av_strcasecmp(arg, "allow") == 0)
1275 acl.action = IP_ALLOW;1274 acl.action = IP_ALLOW;
1276 else if (strcasecmp(arg, "deny") == 0)1275 else if (av_strcasecmp(arg, "deny") == 0)
1277 acl.action = IP_DENY;1276 acl.action = IP_DENY;
1278 else {1277 else {
1279 fprintf(stderr, "%s:%d: ACL action '%s' is not ALLOW or DENY\n",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 continue;1357 continue;
1359 get_arg(cmd, sizeof(cmd), &p);1358 get_arg(cmd, sizeof(cmd), &p);
1360 1359
1361 if (!strcasecmp(cmd, "ACL"))1360 if (!av_strcasecmp(cmd, "ACL"))
1362 parse_acl_row(NULL, NULL, acl, p, stream->dynamic_acl, line_num);1361 parse_acl_row(NULL, NULL, acl, p, stream->dynamic_acl, line_num);
1363 }1362 }
1364 fclose(f);1363 fclose(f);
@@ -1500,7 +1499,7 @@ static int http_parse_request(HTTPContext *c) · 135 unmodified lines
1500 av_strlcpy(filename, url + ((*url == '/') ? 1 : 0), sizeof(filename)-1);1499 av_strlcpy(filename, url + ((*url == '/') ? 1 : 0), sizeof(filename)-1);
1501 1500
1502 for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) {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 useragent = p + 11;1503 useragent = p + 11;
1505 if (*useragent && *useragent != '\n' && isspace(*useragent))1504 if (*useragent && *useragent != '\n' && isspace(*useragent))
1506 useragent++;1505 useragent++;
@@ -1518,7 +1517,7 @@ static int http_parse_request(HTTPContext *c) · 11 unmodified lines
1518 redir_type = REDIR_ASX;1517 redir_type = REDIR_ASX;
1519 filename[strlen(filename)-1] = 'f';1518 filename[strlen(filename)-1] = 'f';
1520 } else if (av_match_ext(filename, "asf") &&1519 } else if (av_match_ext(filename, "asf") &&
1521 (!useragent || strncasecmp(useragent, "NSPlayer", 8) != 0)) {1520 (!useragent || av_strncasecmp(useragent, "NSPlayer", 8) != 0)) {
1522 /* if this isn't WMP or lookalike, return the redirector file */1521 /* if this isn't WMP or lookalike, return the redirector file */
1523 redir_type = REDIR_ASF;1522 redir_type = REDIR_ASF;
1524 } else if (av_match_ext(filename, "rpm,ram")) {1523 } else if (av_match_ext(filename, "rpm,ram")) {
@@ -1613,7 +1612,7 @@ static int http_parse_request(HTTPContext *c) · 88 unmodified lines
1613 char *hostinfo = 0;1612 char *hostinfo = 0;
1614 1613
1615 for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) {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 hostinfo = p + 5;1616 hostinfo = p + 5;
1618 break;1617 break;
1619 }1618 }
@@ -1742,11 +1741,11 @@ static int http_parse_request(HTTPContext *c) · 122 unmodified lines
1742 int client_id = 0;1741 int client_id = 0;
1743 1742
1744 for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) {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 logline = p;1745 logline = p;
1747 break;1746 break;
1748 }1747 }
1749 if (strncasecmp(p, "Pragma: client-id=", 18) == 0)1748 if (av_strncasecmp(p, "Pragma: client-id=", 18) == 0)
1750 client_id = strtol(p + 18, 0, 10);1749 client_id = strtol(p + 18, 0, 10);
1751 p = strchr(p, '\n');1750 p = strchr(p, '\n');
1752 if (!p)1751 if (!p)
@@ -4059,40 +4058,40 @@ static int parse_ffconfig(const char *filename) · 2306 unmodified lines
4059 4058
4060 get_arg(cmd, sizeof(cmd), &p);4059 get_arg(cmd, sizeof(cmd), &p);
4061 4060
4062 if (!strcasecmp(cmd, "Port")) {4061 if (!av_strcasecmp(cmd, "Port")) {
4063 get_arg(arg, sizeof(arg), &p);4062 get_arg(arg, sizeof(arg), &p);
4064 val = atoi(arg);4063 val = atoi(arg);
4065 if (val < 1 || val > 65536) {4064 if (val < 1 || val > 65536) {
4066 ERROR("Invalid_port: %s\n", arg);4065 ERROR("Invalid_port: %s\n", arg);
4067 }4066 }
4068 my_http_addr.sin_port = htons(val);4067 my_http_addr.sin_port = htons(val);
4069 } else if (!strcasecmp(cmd, "BindAddress")) {4068 } else if (!av_strcasecmp(cmd, "BindAddress")) {
4070 get_arg(arg, sizeof(arg), &p);4069 get_arg(arg, sizeof(arg), &p);
4071 if (resolve_host(&my_http_addr.sin_addr, arg) != 0) {4070 if (resolve_host(&my_http_addr.sin_addr, arg) != 0) {
4072 ERROR("%s:%d: Invalid host/IP address: %s\n", arg);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 avserver_daemon = 0;4074 avserver_daemon = 0;
4076 } else if (!strcasecmp(cmd, "RTSPPort")) {4075 } else if (!av_strcasecmp(cmd, "RTSPPort")) {
4077 get_arg(arg, sizeof(arg), &p);4076 get_arg(arg, sizeof(arg), &p);
4078 val = atoi(arg);4077 val = atoi(arg);
4079 if (val < 1 || val > 65536) {4078 if (val < 1 || val > 65536) {
4080 ERROR("%s:%d: Invalid port: %s\n", arg);4079 ERROR("%s:%d: Invalid port: %s\n", arg);
4081 }4080 }
4082 my_rtsp_addr.sin_port = htons(atoi(arg));4081 my_rtsp_addr.sin_port = htons(atoi(arg));
4083 } else if (!strcasecmp(cmd, "RTSPBindAddress")) {4082 } else if (!av_strcasecmp(cmd, "RTSPBindAddress")) {
4084 get_arg(arg, sizeof(arg), &p);4083 get_arg(arg, sizeof(arg), &p);
4085 if (resolve_host(&my_rtsp_addr.sin_addr, arg) != 0) {4084 if (resolve_host(&my_rtsp_addr.sin_addr, arg) != 0) {
4086 ERROR("Invalid host/IP address: %s\n", arg);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 get_arg(arg, sizeof(arg), &p);4088 get_arg(arg, sizeof(arg), &p);
4090 val = atoi(arg);4089 val = atoi(arg);
4091 if (val < 1 || val > 65536) {4090 if (val < 1 || val > 65536) {
4092 ERROR("Invalid MaxHTTPConnections: %s\n", arg);4091 ERROR("Invalid MaxHTTPConnections: %s\n", arg);
4093 }4092 }
4094 nb_max_http_connections = val;4093 nb_max_http_connections = val;
4095 } else if (!strcasecmp(cmd, "MaxClients")) {4094 } else if (!av_strcasecmp(cmd, "MaxClients")) {
4096 get_arg(arg, sizeof(arg), &p);4095 get_arg(arg, sizeof(arg), &p);
4097 val = atoi(arg);4096 val = atoi(arg);
4098 if (val < 1 || val > nb_max_http_connections) {4097 if (val < 1 || val > nb_max_http_connections) {
@@ -4100,7 +4099,7 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line
4100 } else {4099 } else {
4101 nb_max_connections = val;4100 nb_max_connections = val;
4102 }4101 }
4103 } else if (!strcasecmp(cmd, "MaxBandwidth")) {4102 } else if (!av_strcasecmp(cmd, "MaxBandwidth")) {
4104 int64_t llval;4103 int64_t llval;
4105 get_arg(arg, sizeof(arg), &p);4104 get_arg(arg, sizeof(arg), &p);
4106 llval = atoll(arg);4105 llval = atoll(arg);
@@ -4108,10 +4107,10 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line
4108 ERROR("Invalid MaxBandwidth: %s\n", arg);4107 ERROR("Invalid MaxBandwidth: %s\n", arg);
4109 } else4108 } else
4110 max_bandwidth = llval;4109 max_bandwidth = llval;
4111 } else if (!strcasecmp(cmd, "CustomLog")) {4110 } else if (!av_strcasecmp(cmd, "CustomLog")) {
4112 if (!avserver_debug)4111 if (!avserver_debug)
4113 get_arg(logfilename, sizeof(logfilename), &p);4112 get_arg(logfilename, sizeof(logfilename), &p);
4114 } else if (!strcasecmp(cmd, "<Feed")) {4113 } else if (!av_strcasecmp(cmd, "<Feed")) {
4115 /*********************************************/4114 /*********************************************/
4116 /* Feed related options */4115 /* Feed related options */
4117 char *q;4116 char *q;
@@ -4145,7 +4144,7 @@ static int parse_ffconfig(const char *filename) · 27 unmodified lines
4145 *last_feed = feed;4144 *last_feed = feed;
4146 last_feed = &feed->next_feed;4145 last_feed = &feed->next_feed;
4147 }4146 }
4148 } else if (!strcasecmp(cmd, "Launch")) {4147 } else if (!av_strcasecmp(cmd, "Launch")) {
4149 if (feed) {4148 if (feed) {
4150 int i;4149 int i;
4151 4150
@@ -4167,24 +4166,24 @@ static int parse_ffconfig(const char *filename) · 15 unmodified lines
4167 inet_ntoa(my_http_addr.sin_addr),4166 inet_ntoa(my_http_addr.sin_addr),
4168 ntohs(my_http_addr.sin_port), feed->filename);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 if (feed) {4170 if (feed) {
4172 get_arg(feed->feed_filename, sizeof(feed->feed_filename), &p);4171 get_arg(feed->feed_filename, sizeof(feed->feed_filename), &p);
4173 feed->readonly = 1;4172 feed->readonly = 1;
4174 } else if (stream) {4173 } else if (stream) {
4175 get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p);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 if (feed) {4177 if (feed) {
4179 get_arg(feed->feed_filename, sizeof(feed->feed_filename), &p);4178 get_arg(feed->feed_filename, sizeof(feed->feed_filename), &p);
4180 } else if (stream)4179 } else if (stream)
4181 get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p);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 if (feed) {4182 if (feed) {
4184 get_arg(arg, sizeof(arg), &p);4183 get_arg(arg, sizeof(arg), &p);
4185 feed->truncate = strtod(arg, NULL);4184 feed->truncate = strtod(arg, NULL);
4186 }4185 }
4187 } else if (!strcasecmp(cmd, "FileMaxSize")) {4186 } else if (!av_strcasecmp(cmd, "FileMaxSize")) {
4188 if (feed) {4187 if (feed) {
4189 char *p1;4188 char *p1;
4190 double fsize;4189 double fsize;
@@ -4208,12 +4207,12 @@ static int parse_ffconfig(const char *filename) · 17 unmodified lines
4208 ERROR("Feed max file size is too small, must be at least %d\n", FFM_PACKET_SIZE*4);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 if (!feed) {4211 if (!feed) {
4213 ERROR("No corresponding <Feed> for </Feed>\n");4212 ERROR("No corresponding <Feed> for </Feed>\n");
4214 }4213 }
4215 feed = NULL;4214 feed = NULL;
4216 } else if (!strcasecmp(cmd, "<Stream")) {4215 } else if (!av_strcasecmp(cmd, "<Stream")) {
4217 /*********************************************/4216 /*********************************************/
4218 /* Stream related options */4217 /* Stream related options */
4219 char *q;4218 char *q;
@@ -4246,7 +4245,7 @@ static int parse_ffconfig(const char *filename) · 26 unmodified lines
4246 *last_stream = stream;4245 *last_stream = stream;
4247 last_stream = &stream->next;4246 last_stream = &stream->next;
4248 }4247 }
4249 } else if (!strcasecmp(cmd, "Feed")) {4248 } else if (!av_strcasecmp(cmd, "Feed")) {
4250 get_arg(arg, sizeof(arg), &p);4249 get_arg(arg, sizeof(arg), &p);
4251 if (stream) {4250 if (stream) {
4252 FFStream *sfeed;4251 FFStream *sfeed;
@@ -4262,7 +4261,7 @@ static int parse_ffconfig(const char *filename) · 9 unmodified lines
4262 else4261 else
4263 stream->feed = sfeed;4262 stream->feed = sfeed;
4264 }4263 }
4265 } else if (!strcasecmp(cmd, "Format")) {4264 } else if (!av_strcasecmp(cmd, "Format")) {
4266 get_arg(arg, sizeof(arg), &p);4265 get_arg(arg, sizeof(arg), &p);
4267 if (stream) {4266 if (stream) {
4268 if (!strcmp(arg, "status")) {4267 if (!strcmp(arg, "status")) {
@@ -4283,7 +4282,7 @@ static int parse_ffconfig(const char *filename) · 14 unmodified lines
4283 video_id = stream->fmt->video_codec;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 get_arg(arg, sizeof(arg), &p);4286 get_arg(arg, sizeof(arg), &p);
4288 if (stream) {4287 if (stream) {
4289 stream->ifmt = av_find_input_format(arg);4288 stream->ifmt = av_find_input_format(arg);
@@ -4291,65 +4290,65 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line
4291 ERROR("Unknown input format: %s\n", arg);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 if (stream && stream->stream_type == STREAM_TYPE_STATUS) {4294 if (stream && stream->stream_type == STREAM_TYPE_STATUS) {
4296 get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p);4295 get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p);
4297 } else {4296 } else {
4298 ERROR("FaviconURL only permitted for status streams\n");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 if (stream)4300 if (stream)
4302 get_arg(stream->author, sizeof(stream->author), &p);4301 get_arg(stream->author, sizeof(stream->author), &p);
4303 } else if (!strcasecmp(cmd, "Comment")) {4302 } else if (!av_strcasecmp(cmd, "Comment")) {
4304 if (stream)4303 if (stream)
4305 get_arg(stream->comment, sizeof(stream->comment), &p);4304 get_arg(stream->comment, sizeof(stream->comment), &p);
4306 } else if (!strcasecmp(cmd, "Copyright")) {4305 } else if (!av_strcasecmp(cmd, "Copyright")) {
4307 if (stream)4306 if (stream)
4308 get_arg(stream->copyright, sizeof(stream->copyright), &p);4307 get_arg(stream->copyright, sizeof(stream->copyright), &p);
4309 } else if (!strcasecmp(cmd, "Title")) {4308 } else if (!av_strcasecmp(cmd, "Title")) {
4310 if (stream)4309 if (stream)
4311 get_arg(stream->title, sizeof(stream->title), &p);4310 get_arg(stream->title, sizeof(stream->title), &p);
4312 } else if (!strcasecmp(cmd, "Preroll")) {4311 } else if (!av_strcasecmp(cmd, "Preroll")) {
4313 get_arg(arg, sizeof(arg), &p);4312 get_arg(arg, sizeof(arg), &p);
4314 if (stream)4313 if (stream)
4315 stream->prebuffer = atof(arg) * 1000;4314 stream->prebuffer = atof(arg) * 1000;
4316 } else if (!strcasecmp(cmd, "StartSendOnKey")) {4315 } else if (!av_strcasecmp(cmd, "StartSendOnKey")) {
4317 if (stream)4316 if (stream)
4318 stream->send_on_key = 1;4317 stream->send_on_key = 1;
4319 } else if (!strcasecmp(cmd, "AudioCodec")) {4318 } else if (!av_strcasecmp(cmd, "AudioCodec")) {
4320 get_arg(arg, sizeof(arg), &p);4319 get_arg(arg, sizeof(arg), &p);
4321 audio_id = opt_audio_codec(arg);4320 audio_id = opt_audio_codec(arg);
4322 if (audio_id == CODEC_ID_NONE) {4321 if (audio_id == CODEC_ID_NONE) {
4323 ERROR("Unknown AudioCodec: %s\n", arg);4322 ERROR("Unknown AudioCodec: %s\n", arg);
4324 }4323 }
4325 } else if (!strcasecmp(cmd, "VideoCodec")) {4324 } else if (!av_strcasecmp(cmd, "VideoCodec")) {
4326 get_arg(arg, sizeof(arg), &p);4325 get_arg(arg, sizeof(arg), &p);
4327 video_id = opt_video_codec(arg);4326 video_id = opt_video_codec(arg);
4328 if (video_id == CODEC_ID_NONE) {4327 if (video_id == CODEC_ID_NONE) {
4329 ERROR("Unknown VideoCodec: %s\n", arg);4328 ERROR("Unknown VideoCodec: %s\n", arg);
4330 }4329 }
4331 } else if (!strcasecmp(cmd, "MaxTime")) {4330 } else if (!av_strcasecmp(cmd, "MaxTime")) {
4332 get_arg(arg, sizeof(arg), &p);4331 get_arg(arg, sizeof(arg), &p);
4333 if (stream)4332 if (stream)
4334 stream->max_time = atof(arg) * 1000;4333 stream->max_time = atof(arg) * 1000;
4335 } else if (!strcasecmp(cmd, "AudioBitRate")) {4334 } else if (!av_strcasecmp(cmd, "AudioBitRate")) {
4336 get_arg(arg, sizeof(arg), &p);4335 get_arg(arg, sizeof(arg), &p);
4337 if (stream)4336 if (stream)
4338 audio_enc.bit_rate = lrintf(atof(arg) * 1000);4337 audio_enc.bit_rate = lrintf(atof(arg) * 1000);
4339 } else if (!strcasecmp(cmd, "AudioChannels")) {4338 } else if (!av_strcasecmp(cmd, "AudioChannels")) {
4340 get_arg(arg, sizeof(arg), &p);4339 get_arg(arg, sizeof(arg), &p);
4341 if (stream)4340 if (stream)
4342 audio_enc.channels = atoi(arg);4341 audio_enc.channels = atoi(arg);
4343 } else if (!strcasecmp(cmd, "AudioSampleRate")) {4342 } else if (!av_strcasecmp(cmd, "AudioSampleRate")) {
4344 get_arg(arg, sizeof(arg), &p);4343 get_arg(arg, sizeof(arg), &p);
4345 if (stream)4344 if (stream)
4346 audio_enc.sample_rate = atoi(arg);4345 audio_enc.sample_rate = atoi(arg);
4347 } else if (!strcasecmp(cmd, "AudioQuality")) {4346 } else if (!av_strcasecmp(cmd, "AudioQuality")) {
4348 get_arg(arg, sizeof(arg), &p);4347 get_arg(arg, sizeof(arg), &p);
4349 if (stream) {4348 if (stream) {
4350// audio_enc.quality = atof(arg) * 1000;4349// audio_enc.quality = atof(arg) * 1000;
4351 }4350 }
4352 } else if (!strcasecmp(cmd, "VideoBitRateRange")) {4351 } else if (!av_strcasecmp(cmd, "VideoBitRateRange")) {
4353 if (stream) {4352 if (stream) {
4354 int minrate, maxrate;4353 int minrate, maxrate;
4355 4354
@@ -4362,32 +4361,32 @@ static int parse_ffconfig(const char *filename) · 6 unmodified lines
4362 ERROR("Incorrect format for VideoBitRateRange -- should be <min>-<max>: %s\n", arg);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 if (stream) {4365 if (stream) {
4367 get_arg(arg, sizeof(arg), &p);4366 get_arg(arg, sizeof(arg), &p);
4368 video_enc.debug = strtol(arg,0,0);4367 video_enc.debug = strtol(arg,0,0);
4369 }4368 }
4370 } else if (!strcasecmp(cmd, "Strict")) {4369 } else if (!av_strcasecmp(cmd, "Strict")) {
4371 if (stream) {4370 if (stream) {
4372 get_arg(arg, sizeof(arg), &p);4371 get_arg(arg, sizeof(arg), &p);
4373 video_enc.strict_std_compliance = atoi(arg);4372 video_enc.strict_std_compliance = atoi(arg);
4374 }4373 }
4375 } else if (!strcasecmp(cmd, "VideoBufferSize")) {4374 } else if (!av_strcasecmp(cmd, "VideoBufferSize")) {
4376 if (stream) {4375 if (stream) {
4377 get_arg(arg, sizeof(arg), &p);4376 get_arg(arg, sizeof(arg), &p);
4378 video_enc.rc_buffer_size = atoi(arg) * 8*1024;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 if (stream) {4380 if (stream) {
4382 get_arg(arg, sizeof(arg), &p);4381 get_arg(arg, sizeof(arg), &p);
4383 video_enc.bit_rate_tolerance = atoi(arg) * 1000;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 get_arg(arg, sizeof(arg), &p);4385 get_arg(arg, sizeof(arg), &p);
4387 if (stream) {4386 if (stream) {
4388 video_enc.bit_rate = atoi(arg) * 1000;4387 video_enc.bit_rate = atoi(arg) * 1000;
4389 }4388 }
4390 } else if (!strcasecmp(cmd, "VideoSize")) {4389 } else if (!av_strcasecmp(cmd, "VideoSize")) {
4391 get_arg(arg, sizeof(arg), &p);4390 get_arg(arg, sizeof(arg), &p);
4392 if (stream) {4391 if (stream) {
4393 av_parse_video_size(&video_enc.width, &video_enc.height, arg);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 ERROR("Image size must be a multiple of 16\n");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 get_arg(arg, sizeof(arg), &p);4399 get_arg(arg, sizeof(arg), &p);
4401 if (stream) {4400 if (stream) {
4402 AVRational frame_rate;4401 AVRational frame_rate;
@@ -4407,29 +4406,29 @@ static int parse_ffconfig(const char *filename) · 4 unmodified lines
4407 video_enc.time_base.den = frame_rate.num;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 get_arg(arg, sizeof(arg), &p);4410 get_arg(arg, sizeof(arg), &p);
4412 if (stream)4411 if (stream)
4413 video_enc.gop_size = atoi(arg);4412 video_enc.gop_size = atoi(arg);
4414 } else if (!strcasecmp(cmd, "VideoIntraOnly")) {4413 } else if (!av_strcasecmp(cmd, "VideoIntraOnly")) {
4415 if (stream)4414 if (stream)
4416 video_enc.gop_size = 1;4415 video_enc.gop_size = 1;
4417 } else if (!strcasecmp(cmd, "VideoHighQuality")) {4416 } else if (!av_strcasecmp(cmd, "VideoHighQuality")) {
4418 if (stream)4417 if (stream)
4419 video_enc.mb_decision = FF_MB_DECISION_BITS;4418 video_enc.mb_decision = FF_MB_DECISION_BITS;
4420 } else if (!strcasecmp(cmd, "Video4MotionVector")) {4419 } else if (!av_strcasecmp(cmd, "Video4MotionVector")) {
4421 if (stream) {4420 if (stream) {
4422 video_enc.mb_decision = FF_MB_DECISION_BITS; //FIXME remove4421 video_enc.mb_decision = FF_MB_DECISION_BITS; //FIXME remove
4423 video_enc.flags |= CODEC_FLAG_4MV;4422 video_enc.flags |= CODEC_FLAG_4MV;
4424 }4423 }
4425 } else if (!strcasecmp(cmd, "AVOptionVideo") ||4424 } else if (!av_strcasecmp(cmd, "AVOptionVideo") ||
4426 !strcasecmp(cmd, "AVOptionAudio")) {4425 !av_strcasecmp(cmd, "AVOptionAudio")) {
4427 char arg2[1024];4426 char arg2[1024];
4428 AVCodecContext *avctx;4427 AVCodecContext *avctx;
4429 int type;4428 int type;
4430 get_arg(arg, sizeof(arg), &p);4429 get_arg(arg, sizeof(arg), &p);
4431 get_arg(arg2, sizeof(arg2), &p);4430 get_arg(arg2, sizeof(arg2), &p);
4432 if (!strcasecmp(cmd, "AVOptionVideo")) {4431 if (!av_strcasecmp(cmd, "AVOptionVideo")) {
4433 avctx = &video_enc;4432 avctx = &video_enc;
4434 type = AV_OPT_FLAG_VIDEO_PARAM;4433 type = AV_OPT_FLAG_VIDEO_PARAM;
4435 } else {4434 } else {
@@ -4439,12 +4438,12 @@ static int parse_ffconfig(const char *filename) · 3 unmodified lines
4439 if (avserver_opt_default(arg, arg2, avctx, type|AV_OPT_FLAG_ENCODING_PARAM)) {4438 if (avserver_opt_default(arg, arg2, avctx, type|AV_OPT_FLAG_ENCODING_PARAM)) {
4440 ERROR("AVOption error: %s %s\n", arg, arg2);4439 ERROR("AVOption error: %s %s\n", arg, arg2);
4441 }4440 }
4442 } else if (!strcasecmp(cmd, "AVPresetVideo") ||4441 } else if (!av_strcasecmp(cmd, "AVPresetVideo") ||
4443 !strcasecmp(cmd, "AVPresetAudio")) {4442 !av_strcasecmp(cmd, "AVPresetAudio")) {
4444 AVCodecContext *avctx;4443 AVCodecContext *avctx;
4445 int type;4444 int type;
4446 get_arg(arg, sizeof(arg), &p);4445 get_arg(arg, sizeof(arg), &p);
4447 if (!strcasecmp(cmd, "AVPresetVideo")) {4446 if (!av_strcasecmp(cmd, "AVPresetVideo")) {
4448 avctx = &video_enc;4447 avctx = &video_enc;
4449 video_enc.codec_id = video_id;4448 video_enc.codec_id = video_id;
4450 type = AV_OPT_FLAG_VIDEO_PARAM;4449 type = AV_OPT_FLAG_VIDEO_PARAM;
@@ -4456,26 +4455,26 @@ static int parse_ffconfig(const char *filename) · 5 unmodified lines
4456 if (avserver_opt_preset(arg, avctx, type|AV_OPT_FLAG_ENCODING_PARAM, &audio_id, &video_id)) {4455 if (avserver_opt_preset(arg, avctx, type|AV_OPT_FLAG_ENCODING_PARAM, &audio_id, &video_id)) {
4457 ERROR("AVPreset error: %s\n", arg);4456 ERROR("AVPreset error: %s\n", arg);
4458 }4457 }
4459 } else if (!strcasecmp(cmd, "VideoTag")) {4458 } else if (!av_strcasecmp(cmd, "VideoTag")) {
4460 get_arg(arg, sizeof(arg), &p);4459 get_arg(arg, sizeof(arg), &p);
4461 if ((strlen(arg) == 4) && stream)4460 if ((strlen(arg) == 4) && stream)
4462 video_enc.codec_tag = MKTAG(arg[0], arg[1], arg[2], arg[3]);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 if (stream)4463 if (stream)
4465 video_enc.flags |= CODEC_FLAG_BITEXACT;4464 video_enc.flags |= CODEC_FLAG_BITEXACT;
4466 } else if (!strcasecmp(cmd, "DctFastint")) {4465 } else if (!av_strcasecmp(cmd, "DctFastint")) {
4467 if (stream)4466 if (stream)
4468 video_enc.dct_algo = FF_DCT_FASTINT;4467 video_enc.dct_algo = FF_DCT_FASTINT;
4469 } else if (!strcasecmp(cmd, "IdctSimple")) {4468 } else if (!av_strcasecmp(cmd, "IdctSimple")) {
4470 if (stream)4469 if (stream)
4471 video_enc.idct_algo = FF_IDCT_SIMPLE;4470 video_enc.idct_algo = FF_IDCT_SIMPLE;
4472 } else if (!strcasecmp(cmd, "Qscale")) {4471 } else if (!av_strcasecmp(cmd, "Qscale")) {
4473 get_arg(arg, sizeof(arg), &p);4472 get_arg(arg, sizeof(arg), &p);
4474 if (stream) {4473 if (stream) {
4475 video_enc.flags |= CODEC_FLAG_QSCALE;4474 video_enc.flags |= CODEC_FLAG_QSCALE;
4476 video_enc.global_quality = FF_QP2LAMBDA * atoi(arg);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 get_arg(arg, sizeof(arg), &p);4478 get_arg(arg, sizeof(arg), &p);
4480 if (stream) {4479 if (stream) {
4481 video_enc.max_qdiff = atoi(arg);4480 video_enc.max_qdiff = atoi(arg);
@@ -4483,7 +4482,7 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line
4483 ERROR("VideoQDiff out of range\n");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 get_arg(arg, sizeof(arg), &p);4486 get_arg(arg, sizeof(arg), &p);
4488 if (stream) {4487 if (stream) {
4489 video_enc.qmax = atoi(arg);4488 video_enc.qmax = atoi(arg);
@@ -4491,7 +4490,7 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line
4491 ERROR("VideoQMax out of range\n");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 get_arg(arg, sizeof(arg), &p);4494 get_arg(arg, sizeof(arg), &p);
4496 if (stream) {4495 if (stream) {
4497 video_enc.qmin = atoi(arg);4496 video_enc.qmin = atoi(arg);
@@ -4499,39 +4498,39 @@ static int parse_ffconfig(const char *filename) · 1 unmodified line
4499 ERROR("VideoQMin out of range\n");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 get_arg(arg, sizeof(arg), &p);4502 get_arg(arg, sizeof(arg), &p);
4504 if (stream)4503 if (stream)
4505 video_enc.luma_elim_threshold = atoi(arg);4504 video_enc.luma_elim_threshold = atoi(arg);
4506 } else if (!strcasecmp(cmd, "ChromaElim")) {4505 } else if (!av_strcasecmp(cmd, "ChromaElim")) {
4507 get_arg(arg, sizeof(arg), &p);4506 get_arg(arg, sizeof(arg), &p);
4508 if (stream)4507 if (stream)
4509 video_enc.chroma_elim_threshold = atoi(arg);4508 video_enc.chroma_elim_threshold = atoi(arg);
4510 } else if (!strcasecmp(cmd, "LumiMask")) {4509 } else if (!av_strcasecmp(cmd, "LumiMask")) {
4511 get_arg(arg, sizeof(arg), &p);4510 get_arg(arg, sizeof(arg), &p);
4512 if (stream)4511 if (stream)
4513 video_enc.lumi_masking = atof(arg);4512 video_enc.lumi_masking = atof(arg);
4514 } else if (!strcasecmp(cmd, "DarkMask")) {4513 } else if (!av_strcasecmp(cmd, "DarkMask")) {
4515 get_arg(arg, sizeof(arg), &p);4514 get_arg(arg, sizeof(arg), &p);
4516 if (stream)4515 if (stream)
4517 video_enc.dark_masking = atof(arg);4516 video_enc.dark_masking = atof(arg);
4518 } else if (!strcasecmp(cmd, "NoVideo")) {4517 } else if (!av_strcasecmp(cmd, "NoVideo")) {
4519 video_id = CODEC_ID_NONE;4518 video_id = CODEC_ID_NONE;
4520 } else if (!strcasecmp(cmd, "NoAudio")) {4519 } else if (!av_strcasecmp(cmd, "NoAudio")) {
4521 audio_id = CODEC_ID_NONE;4520 audio_id = CODEC_ID_NONE;
4522 } else if (!strcasecmp(cmd, "ACL")) {4521 } else if (!av_strcasecmp(cmd, "ACL")) {
4523 parse_acl_row(stream, feed, NULL, p, filename, line_num);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 if (stream) {4524 if (stream) {
4526 get_arg(stream->dynamic_acl, sizeof(stream->dynamic_acl), &p);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 get_arg(arg, sizeof(arg), &p);4528 get_arg(arg, sizeof(arg), &p);
4530 if (stream) {4529 if (stream) {
4531 av_freep(&stream->rtsp_option);4530 av_freep(&stream->rtsp_option);
4532 stream->rtsp_option = av_strdup(arg);4531 stream->rtsp_option = av_strdup(arg);
4533 }4532 }
4534 } else if (!strcasecmp(cmd, "MulticastAddress")) {4533 } else if (!av_strcasecmp(cmd, "MulticastAddress")) {
4535 get_arg(arg, sizeof(arg), &p);4534 get_arg(arg, sizeof(arg), &p);
4536 if (stream) {4535 if (stream) {
4537 if (resolve_host(&stream->multicast_ip, arg) != 0) {4536 if (resolve_host(&stream->multicast_ip, arg) != 0) {
@@ -4540,18 +4539,18 @@ static int parse_ffconfig(const char *filename) · 2 unmodified lines
4540 stream->is_multicast = 1;4539 stream->is_multicast = 1;
4541 stream->loop = 1; /* default is looping */4540 stream->loop = 1; /* default is looping */
4542 }4541 }
4543 } else if (!strcasecmp(cmd, "MulticastPort")) {4542 } else if (!av_strcasecmp(cmd, "MulticastPort")) {
4544 get_arg(arg, sizeof(arg), &p);4543 get_arg(arg, sizeof(arg), &p);
4545 if (stream)4544 if (stream)
4546 stream->multicast_port = atoi(arg);4545 stream->multicast_port = atoi(arg);
4547 } else if (!strcasecmp(cmd, "MulticastTTL")) {4546 } else if (!av_strcasecmp(cmd, "MulticastTTL")) {
4548 get_arg(arg, sizeof(arg), &p);4547 get_arg(arg, sizeof(arg), &p);
4549 if (stream)4548 if (stream)
4550 stream->multicast_ttl = atoi(arg);4549 stream->multicast_ttl = atoi(arg);
4551 } else if (!strcasecmp(cmd, "NoLoop")) {4550 } else if (!av_strcasecmp(cmd, "NoLoop")) {
4552 if (stream)4551 if (stream)
4553 stream->loop = 0;4552 stream->loop = 0;
4554 } else if (!strcasecmp(cmd, "</Stream>")) {4553 } else if (!av_strcasecmp(cmd, "</Stream>")) {
4555 if (!stream) {4554 if (!stream) {
4556 ERROR("No corresponding <Stream> for </Stream>\n");4555 ERROR("No corresponding <Stream> for </Stream>\n");
4557 } else {4556 } else {
@@ -4569,7 +4568,7 @@ static int parse_ffconfig(const char *filename) · 11 unmodified lines
4569 }4568 }
4570 stream = NULL;4569 stream = NULL;
4571 }4570 }
4572 } else if (!strcasecmp(cmd, "<Redirect")) {4571 } else if (!av_strcasecmp(cmd, "<Redirect")) {
4573 /*********************************************/4572 /*********************************************/
4574 char *q;4573 char *q;
4575 if (stream || feed || redirect) {4574 if (stream || feed || redirect) {
@@ -4585,10 +4584,10 @@ static int parse_ffconfig(const char *filename) · 9 unmodified lines
4585 *q = '\0';4584 *q = '\0';
4586 redirect->stream_type = STREAM_TYPE_REDIRECT;4585 redirect->stream_type = STREAM_TYPE_REDIRECT;
4587 }4586 }
4588 } else if (!strcasecmp(cmd, "URL")) {4587 } else if (!av_strcasecmp(cmd, "URL")) {
4589 if (redirect)4588 if (redirect)
4590 get_arg(redirect->feed_filename, sizeof(redirect->feed_filename), &p);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 if (!redirect) {4591 if (!redirect) {
4593 ERROR("No corresponding <Redirect> for </Redirect>\n");4592 ERROR("No corresponding <Redirect> for </Redirect>\n");
4594 } else {4593 } else {
@@ -4597,7 +4596,7 @@ static int parse_ffconfig(const char *filename) · 2 unmodified lines
4597 }4596 }
4598 redirect = NULL;4597 redirect = NULL;
4599 }4598 }
4600 } else if (!strcasecmp(cmd, "LoadModule")) {4599 } else if (!av_strcasecmp(cmd, "LoadModule")) {
4601 get_arg(arg, sizeof(arg), &p);4600 get_arg(arg, sizeof(arg), &p);
4602#if HAVE_DLOPEN4601#if HAVE_DLOPEN
4603 load_module(arg);4602 load_module(arg);
libavdevice/v4l2.c+2−2
@@ -42,12 +42,12 @@ · 41 unmodified lines
42#include <linux/videodev2.h>42#include <linux/videodev2.h>
43#endif43#endif
44#include <time.h>44#include <time.h>
45#include <strings.h>
46#include "libavutil/imgutils.h"45#include "libavutil/imgutils.h"
47#include "libavutil/log.h"46#include "libavutil/log.h"
48#include "libavutil/opt.h"47#include "libavutil/opt.h"
49#include "libavutil/parseutils.h"48#include "libavutil/parseutils.h"
50#include "libavutil/pixdesc.h"49#include "libavutil/pixdesc.h"
50#include "libavutil/avstring.h"
51 51
52static const int desired_video_buffers = 256;52static const int desired_video_buffers = 256;
53 53
@@ -493,7 +493,7 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap) · 439 unmodified lines
493 return AVERROR(EIO);493 return AVERROR(EIO);
494 }494 }
495 495
496 if (!strcasecmp(standard.name, s->standard)) {496 if (!av_strcasecmp(standard.name, s->standard)) {
497 break;497 break;
498 }498 }
499 }499 }
libavformat/avidec.c+2−2
@@ -19,11 +19,11 @@ · 18 unmodified lines
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */20 */
21 21
22#include <strings.h>
23#include "libavutil/intreadwrite.h"22#include "libavutil/intreadwrite.h"
24#include "libavutil/mathematics.h"23#include "libavutil/mathematics.h"
25#include "libavutil/bswap.h"24#include "libavutil/bswap.h"
26#include "libavutil/dict.h"25#include "libavutil/dict.h"
26#include "libavutil/avstring.h"
27#include "avformat.h"27#include "avformat.h"
28#include "avi.h"28#include "avi.h"
29#include "dv.h"29#include "dv.h"
@@ -281,7 +281,7 @@ static void avi_metadata_creation_time(AVDictionary **metadata, char *date) · 251 unmodified lines
281 if (sscanf(date, "%*3s%*[ ]%3s%*[ ]%2d%*[ ]%8s%*[ ]%4d",281 if (sscanf(date, "%*3s%*[ ]%3s%*[ ]%2d%*[ ]%8s%*[ ]%4d",
282 month, &day, time, &year) == 4) {282 month, &day, time, &year) == 4) {
283 for (i=0; i<12; i++)283 for (i=0; i<12; i++)
284 if (!strcasecmp(month, months[i])) {284 if (!av_strcasecmp(month, months[i])) {
285 snprintf(buffer, sizeof(buffer), "%.4d-%.2d-%.2d %s",285 snprintf(buffer, sizeof(buffer), "%.4d-%.2d-%.2d %s",
286 year, i+1, day, time);286 year, i+1, day, time);
287 av_dict_set(metadata, "creation_time", buffer, 0);287 av_dict_set(metadata, "creation_time", buffer, 0);
libavformat/http.c+8−9
@@ -22,7 +22,6 @@ · 21 unmodified lines
22#include "libavutil/avstring.h"22#include "libavutil/avstring.h"
23#include "avformat.h"23#include "avformat.h"
24#include <unistd.h>24#include <unistd.h>
25#include <strings.h>
26#include "internal.h"25#include "internal.h"
27#include "network.h"26#include "network.h"
28#include "http.h"27#include "http.h"
@@ -251,12 +250,12 @@ static int process_line(URLContext *h, char *line, int line_count, · 222 unmodified lines
251 p++;250 p++;
252 while (isspace(*p))251 while (isspace(*p))
253 p++;252 p++;
254 if (!strcasecmp(tag, "Location")) {253 if (!av_strcasecmp(tag, "Location")) {
255 strcpy(s->location, p);254 strcpy(s->location, p);
256 *new_location = 1;255 *new_location = 1;
257 } else if (!strcasecmp (tag, "Content-Length") && s->filesize == -1) {256 } else if (!av_strcasecmp (tag, "Content-Length") && s->filesize == -1) {
258 s->filesize = atoll(p);257 s->filesize = atoll(p);
259 } else if (!strcasecmp (tag, "Content-Range")) {258 } else if (!av_strcasecmp (tag, "Content-Range")) {
260 /* "bytes $from-$to/$document_size" */259 /* "bytes $from-$to/$document_size" */
261 const char *slash;260 const char *slash;
262 if (!strncmp (p, "bytes ", 6)) {261 if (!strncmp (p, "bytes ", 6)) {
@@ -266,16 +265,16 @@ static int process_line(URLContext *h, char *line, int line_count, · 3 unmodified lines
266 s->filesize = atoll(slash+1);265 s->filesize = atoll(slash+1);
267 }266 }
268 h->is_streamed = 0; /* we _can_ in fact seek */267 h->is_streamed = 0; /* we _can_ in fact seek */
269 } else if (!strcasecmp(tag, "Accept-Ranges") && !strncmp(p, "bytes", 5)) {268 } else if (!av_strcasecmp(tag, "Accept-Ranges") && !strncmp(p, "bytes", 5)) {
270 h->is_streamed = 0;269 h->is_streamed = 0;
271 } else if (!strcasecmp (tag, "Transfer-Encoding") && !strncasecmp(p, "chunked", 7)) {270 } else if (!av_strcasecmp (tag, "Transfer-Encoding") && !av_strncasecmp(p, "chunked", 7)) {
272 s->filesize = -1;271 s->filesize = -1;
273 s->chunksize = 0;272 s->chunksize = 0;
274 } else if (!strcasecmp (tag, "WWW-Authenticate")) {273 } else if (!av_strcasecmp (tag, "WWW-Authenticate")) {
275 ff_http_auth_handle_header(&s->auth_state, tag, p);274 ff_http_auth_handle_header(&s->auth_state, tag, p);
276 } else if (!strcasecmp (tag, "Authentication-Info")) {275 } else if (!av_strcasecmp (tag, "Authentication-Info")) {
277 ff_http_auth_handle_header(&s->auth_state, tag, p);276 ff_http_auth_handle_header(&s->auth_state, tag, p);
278 } else if (!strcasecmp (tag, "Connection")) {277 } else if (!av_strcasecmp (tag, "Connection")) {
279 if (!strcmp(p, "close"))278 if (!strcmp(p, "close"))
280 s->willclose = 1;279 s->willclose = 1;
281 }280 }
libavformat/img2.c+1−2
@@ -29,7 +29,6 @@ · 28 unmodified lines
29#include "avformat.h"29#include "avformat.h"
30#include "avio_internal.h"30#include "avio_internal.h"
31#include "internal.h"31#include "internal.h"
32#include <strings.h>
33 32
34typedef struct {33typedef struct {
35 const AVClass *class; /**< Class for private options. */34 const AVClass *class; /**< Class for private options. */
@@ -121,7 +120,7 @@ static enum CodecID av_str2id(const IdStrMap *tags, const char *str) · 85 unmodified lines
121 str++;120 str++;
122 121
123 while (tags->id) {122 while (tags->id) {
124 if (!strcasecmp(str, tags->str))123 if (!av_strcasecmp(str, tags->str))
125 return tags->id;124 return tags->id;
126 125
127 tags++;126 tags++;
libavformat/matroskaenc.c+2−2
@@ -33,9 +33,9 @@ · 32 unmodified lines
33#include "libavutil/random_seed.h"33#include "libavutil/random_seed.h"
34#include "libavutil/lfg.h"34#include "libavutil/lfg.h"
35#include "libavutil/dict.h"35#include "libavutil/dict.h"
36#include "libavutil/avstring.h"
36#include "libavcodec/xiph.h"37#include "libavcodec/xiph.h"
37#include "libavcodec/mpeg4audio.h"38#include "libavcodec/mpeg4audio.h"
38#include <strings.h>
39 39
40typedef struct ebml_master {40typedef struct ebml_master {
41 int64_t pos; ///< absolute offset in the file where the master's elements start41 int64_t pos; ///< absolute offset in the file where the master's elements start
@@ -760,7 +760,7 @@ static int mkv_write_tag(AVFormatContext *s, AVDictionary *m, unsigned int eleme · 718 unmodified lines
760 end_ebml_master(s->pb, targets);760 end_ebml_master(s->pb, targets);
761 761
762 while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX)))762 while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX)))
763 if (strcasecmp(t->key, "title"))763 if (av_strcasecmp(t->key, "title"))
764 mkv_write_simpletag(s->pb, t);764 mkv_write_simpletag(s->pb, t);
765 765
766 end_ebml_master(s->pb, tag);766 end_ebml_master(s->pb, tag);
libavformat/metadata.c+3−3
@@ -18,10 +18,10 @@ · 17 unmodified lines
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */19 */
20 20
21#include <strings.h>
22#include "avformat.h"21#include "avformat.h"
23#include "metadata.h"22#include "metadata.h"
24#include "libavutil/dict.h"23#include "libavutil/dict.h"
24#include "libavutil/avstring.h"
25 25
26#if FF_API_OLD_METADATA226#if FF_API_OLD_METADATA2
27AVDictionaryEntry *27AVDictionaryEntry *
@@ -69,13 +69,13 @@ void ff_metadata_conv(AVDictionary **pm, const AVMetadataConv *d_conv, · 41 unmodified lines
69 key = mtag->key;69 key = mtag->key;
70 if (s_conv)70 if (s_conv)
71 for (sc=s_conv; sc->native; sc++)71 for (sc=s_conv; sc->native; sc++)
72 if (!strcasecmp(key, sc->native)) {72 if (!av_strcasecmp(key, sc->native)) {
73 key = sc->generic;73 key = sc->generic;
74 break;74 break;
75 }75 }
76 if (d_conv)76 if (d_conv)
77 for (dc=d_conv; dc->native; dc++)77 for (dc=d_conv; dc->native; dc++)
78 if (!strcasecmp(key, dc->generic)) {78 if (!av_strcasecmp(key, dc->generic)) {
79 key = dc->native;79 key = dc->native;
80 break;80 break;
81 }81 }
libavformat/mp3enc.c+1−2
@@ -19,7 +19,6 @@ · 18 unmodified lines
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */20 */
21 21
22#include <strings.h>
23#include "avformat.h"22#include "avformat.h"
24#include "avio_internal.h"23#include "avio_internal.h"
25#include "id3v1.h"24#include "id3v1.h"
@@ -64,7 +63,7 @@ static int id3v1_create_tag(AVFormatContext *s, uint8_t *buf) · 38 unmodified lines
64 buf[127] = 0xFF; /* default to unknown genre */63 buf[127] = 0xFF; /* default to unknown genre */
65 if ((tag = av_dict_get(s->metadata, "TCON", NULL, 0))) { //genre64 if ((tag = av_dict_get(s->metadata, "TCON", NULL, 0))) { //genre
66 for(i = 0; i <= ID3v1_GENRE_MAX; i++) {65 for(i = 0; i <= ID3v1_GENRE_MAX; i++) {
67 if (!strcasecmp(tag->value, ff_id3v1_genre_str[i])) {66 if (!av_strcasecmp(tag->value, ff_id3v1_genre_str[i])) {
68 buf[127] = i;67 buf[127] = i;
69 count++;68 count++;
70 break;69 break;
libavformat/nutdec.c+2−3
@@ -20,7 +20,6 @@ · 19 unmodified lines
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */21 */
22 22
23#include <strings.h>
24#include "libavutil/avstring.h"23#include "libavutil/avstring.h"
25#include "libavutil/bswap.h"24#include "libavutil/bswap.h"
26#include "libavutil/dict.h"25#include "libavutil/dict.h"
@@ -459,8 +458,8 @@ static int decode_info_header(NUTContext *nut){ · 432 unmodified lines
459 set_disposition_bits(s, str_value, stream_id_plus1 - 1);458 set_disposition_bits(s, str_value, stream_id_plus1 - 1);
460 continue;459 continue;
461 }460 }
462 if(metadata && strcasecmp(name,"Uses")461 if(metadata && av_strcasecmp(name,"Uses")
463 && strcasecmp(name,"Depends") && strcasecmp(name,"Replaces"))462 && av_strcasecmp(name,"Depends") && av_strcasecmp(name,"Replaces"))
464 av_dict_set(metadata, name, str_value, 0);463 av_dict_set(metadata, name, str_value, 0);
465 }464 }
466 }465 }
libavformat/rtpdec.c+2−2
@@ -20,13 +20,13 @@ · 19 unmodified lines
20 */20 */
21 21
22#include "libavutil/mathematics.h"22#include "libavutil/mathematics.h"
23#include "libavutil/avstring.h"
23#include "libavcodec/get_bits.h"24#include "libavcodec/get_bits.h"
24#include "avformat.h"25#include "avformat.h"
25#include "mpegts.h"26#include "mpegts.h"
26#include "url.h"27#include "url.h"
27 28
28#include <unistd.h>29#include <unistd.h>
29#include <strings.h>
30#include "network.h"30#include "network.h"
31 31
32#include "rtpdec.h"32#include "rtpdec.h"
@@ -91,7 +91,7 @@ RTPDynamicProtocolHandler *ff_rtp_handler_find_by_name(const char *name, · 58 unmodified lines
91 RTPDynamicProtocolHandler *handler;91 RTPDynamicProtocolHandler *handler;
92 for (handler = RTPFirstDynamicPayloadHandler;92 for (handler = RTPFirstDynamicPayloadHandler;
93 handler; handler = handler->next)93 handler; handler = handler->next)
94 if (!strcasecmp(name, handler->enc_name) &&94 if (!av_strcasecmp(name, handler->enc_name) &&
95 codec_type == handler->codec_type)95 codec_type == handler->codec_type)
96 return handler;96 return handler;
97 return NULL;97 return NULL;
libavformat/rtpdec_mpeg4.c+1−2
@@ -31,7 +31,6 @@ · 30 unmodified lines
31#include "internal.h"31#include "internal.h"
32#include "libavutil/avstring.h"32#include "libavutil/avstring.h"
33#include "libavcodec/get_bits.h"33#include "libavcodec/get_bits.h"
34#include <strings.h>
35 34
36/** Structure listing useful vars to parse RTP packet payload*/35/** Structure listing useful vars to parse RTP packet payload*/
37struct PayloadContext36struct PayloadContext
@@ -206,7 +205,7 @@ static int parse_fmtp(AVStream *stream, PayloadContext *data, · 168 unmodified lines
206 if (codec->codec_id == CODEC_ID_AAC) {205 if (codec->codec_id == CODEC_ID_AAC) {
207 /* Looking for a known attribute */206 /* Looking for a known attribute */
208 for (i = 0; attr_names[i].str; ++i) {207 for (i = 0; attr_names[i].str; ++i) {
209 if (!strcasecmp(attr, attr_names[i].str)) {208 if (!av_strcasecmp(attr, attr_names[i].str)) {
210 if (attr_names[i].type == ATTR_NAME_TYPE_INT) {209 if (attr_names[i].type == ATTR_NAME_TYPE_INT) {
211 *(int *)((char *)data+210 *(int *)((char *)data+
212 attr_names[i].offset) = atoi(value);211 attr_names[i].offset) = atoi(value);
libavformat/rtsp.c+5−6
@@ -34,7 +34,6 @@ · 33 unmodified lines
34#if HAVE_POLL_H34#if HAVE_POLL_H
35#include <poll.h>35#include <poll.h>
36#endif36#endif
37#include <strings.h>
38#include "internal.h"37#include "internal.h"
39#include "network.h"38#include "network.h"
40#include "os_support.h"39#include "os_support.h"
@@ -661,7 +660,7 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p) · 620 unmodified lines
661 660
662 get_word_sep(transport_protocol, sizeof(transport_protocol),661 get_word_sep(transport_protocol, sizeof(transport_protocol),
663 "/", &p);662 "/", &p);
664 if (!strcasecmp (transport_protocol, "rtp")) {663 if (!av_strcasecmp (transport_protocol, "rtp")) {
665 get_word_sep(profile, sizeof(profile), "/;,", &p);664 get_word_sep(profile, sizeof(profile), "/;,", &p);
666 lower_transport[0] = '\0';665 lower_transport[0] = '\0';
667 /* rtp/avp/<protocol> */666 /* rtp/avp/<protocol> */
@@ -670,14 +669,14 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p) · 2 unmodified lines
670 ";,", &p);669 ";,", &p);
671 }670 }
672 th->transport = RTSP_TRANSPORT_RTP;671 th->transport = RTSP_TRANSPORT_RTP;
673 } else if (!strcasecmp (transport_protocol, "x-pn-tng") ||672 } else if (!av_strcasecmp (transport_protocol, "x-pn-tng") ||
674 !strcasecmp (transport_protocol, "x-real-rdt")) {673 !av_strcasecmp (transport_protocol, "x-real-rdt")) {
675 /* x-pn-tng/<protocol> */674 /* x-pn-tng/<protocol> */
676 get_word_sep(lower_transport, sizeof(lower_transport), "/;,", &p);675 get_word_sep(lower_transport, sizeof(lower_transport), "/;,", &p);
677 profile[0] = '\0';676 profile[0] = '\0';
678 th->transport = RTSP_TRANSPORT_RDT;677 th->transport = RTSP_TRANSPORT_RDT;
679 }678 }
680 if (!strcasecmp(lower_transport, "TCP"))679 if (!av_strcasecmp(lower_transport, "TCP"))
681 th->lower_transport = RTSP_LOWER_TRANSPORT_TCP;680 th->lower_transport = RTSP_LOWER_TRANSPORT_TCP;
682 else681 else
683 th->lower_transport = RTSP_LOWER_TRANSPORT_UDP;682 th->lower_transport = RTSP_LOWER_TRANSPORT_UDP;
@@ -1556,7 +1555,7 @@ redirect: · 872 unmodified lines
1556 if (rt->server_type != RTSP_SERVER_REAL && reply->real_challenge[0]) {1555 if (rt->server_type != RTSP_SERVER_REAL && reply->real_challenge[0]) {
1557 rt->server_type = RTSP_SERVER_REAL;1556 rt->server_type = RTSP_SERVER_REAL;
1558 continue;1557 continue;
1559 } else if (!strncasecmp(reply->server, "WMServer/", 9)) {1558 } else if (!av_strncasecmp(reply->server, "WMServer/", 9)) {
1560 rt->server_type = RTSP_SERVER_WMS;1559 rt->server_type = RTSP_SERVER_WMS;
1561 } else if (rt->server_type == RTSP_SERVER_REAL)1560 } else if (rt->server_type == RTSP_SERVER_REAL)
1562 strcpy(real_challenge, reply->real_challenge);1561 strcpy(real_challenge, reply->real_challenge);
libavformat/utils.c+3−4
@@ -37,7 +37,6 @@ · 36 unmodified lines
37#include "url.h"37#include "url.h"
38#include <sys/time.h>38#include <sys/time.h>
39#include <time.h>39#include <time.h>
40#include <strings.h>
41#include <stdarg.h>40#include <stdarg.h>
42#if CONFIG_NETWORK41#if CONFIG_NETWORK
43#include "network.h"42#include "network.h"
@@ -169,7 +168,7 @@ int av_match_ext(const char *filename, const char *extensions) · 125 unmodified lines
169 while (*p != '\0' && *p != ',' && q-ext1<sizeof(ext1)-1)168 while (*p != '\0' && *p != ',' && q-ext1<sizeof(ext1)-1)
170 *q++ = *p++;169 *q++ = *p++;
171 *q = '\0';170 *q = '\0';
172 if (!strcasecmp(ext1, ext))171 if (!av_strcasecmp(ext1, ext))
173 return 1;172 return 1;
174 if (*p == '\0')173 if (*p == '\0')
175 break;174 break;
@@ -190,11 +189,11 @@ static int match_format(const char *name, const char *names) · 14 unmodified lines
190 namelen = strlen(name);189 namelen = strlen(name);
191 while ((p = strchr(names, ','))) {190 while ((p = strchr(names, ','))) {
192 len = FFMAX(p - names, namelen);191 len = FFMAX(p - names, namelen);
193 if (!strncasecmp(name, names, len))192 if (!av_strncasecmp(name, names, len))
194 return 1;193 return 1;
195 names = p+1;194 names = p+1;
196 }195 }
197 return !strcasecmp(name, names);196 return !av_strcasecmp(name, names);
198}197}
199 198
200AVOutputFormat *av_guess_format(const char *short_name, const char *filename,199AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
libavutil/parseutils.c+3−4
@@ -21,7 +21,6 @@ · 20 unmodified lines
21 * misc parsing utilities21 * misc parsing utilities
22 */22 */
23 23
24#include <strings.h>
25#include <sys/time.h>24#include <sys/time.h>
26#include <time.h>25#include <time.h>
27 26
@@ -294,7 +293,7 @@ static ColorEntry color_table[] = { · 266 unmodified lines
294 293
295static int color_table_compare(const void *lhs, const void *rhs)294static int color_table_compare(const void *lhs, const void *rhs)
296{295{
297 return strcasecmp(lhs, ((const ColorEntry *)rhs)->name);296 return av_strcasecmp(lhs, ((const ColorEntry *)rhs)->name);
298}297}
299 298
300#define ALPHA_SEP '@'299#define ALPHA_SEP '@'
@@ -320,7 +319,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, · 19 unmodified lines
320 len = strlen(color_string2);319 len = strlen(color_string2);
321 rgba_color[3] = 255;320 rgba_color[3] = 255;
322 321
323 if (!strcasecmp(color_string2, "random") || !strcasecmp(color_string2, "bikeshed")) {322 if (!av_strcasecmp(color_string2, "random") || !av_strcasecmp(color_string2, "bikeshed")) {
324 int rgba = av_get_random_seed();323 int rgba = av_get_random_seed();
325 rgba_color[0] = rgba >> 24;324 rgba_color[0] = rgba >> 24;
326 rgba_color[1] = rgba >> 16;325 rgba_color[1] = rgba >> 16;
@@ -515,7 +514,7 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration) · 188 unmodified lines
515 p = timestr;514 p = timestr;
516 q = NULL;515 q = NULL;
517 if (!duration) {516 if (!duration) {
518 if (!strncasecmp(timestr, "now", len)) {517 if (!av_strncasecmp(timestr, "now", len)) {
519 *timeval = (int64_t) now * 1000000;518 *timeval = (int64_t) now * 1000000;
520 return 0;519 return 0;
521 }520 }

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