non-const 2nd parameter for strtol/strtod
Originally committed as revision 11803 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
2755e41d26
commit
815f98cce4
27
ffmpeg.c
27
ffmpeg.c
@ -2396,16 +2396,17 @@ static void opt_frame_aspect_ratio(const char *arg)
|
|||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
double ar = 0;
|
double ar = 0;
|
||||||
const char *p;
|
const char *p;
|
||||||
|
char *end;
|
||||||
|
|
||||||
p = strchr(arg, ':');
|
p = strchr(arg, ':');
|
||||||
if (p) {
|
if (p) {
|
||||||
x = strtol(arg, (char **)&arg, 10);
|
x = strtol(arg, &end, 10);
|
||||||
if (arg == p)
|
if (end == p)
|
||||||
y = strtol(arg+1, (char **)&arg, 10);
|
y = strtol(end+1, &end, 10);
|
||||||
if (x > 0 && y > 0)
|
if (x > 0 && y > 0)
|
||||||
ar = (double)x / (double)y;
|
ar = (double)x / (double)y;
|
||||||
} else
|
} else
|
||||||
ar = strtod(arg, (char **)&arg);
|
ar = strtod(arg, NULL);
|
||||||
|
|
||||||
if (!ar) {
|
if (!ar) {
|
||||||
fprintf(stderr, "Incorrect aspect ratio specification.\n");
|
fprintf(stderr, "Incorrect aspect ratio specification.\n");
|
||||||
@ -2543,22 +2544,21 @@ static void opt_subtitle_codec(const char *arg)
|
|||||||
static void opt_map(const char *arg)
|
static void opt_map(const char *arg)
|
||||||
{
|
{
|
||||||
AVStreamMap *m;
|
AVStreamMap *m;
|
||||||
const char *p;
|
char *p;
|
||||||
|
|
||||||
p = arg;
|
|
||||||
m = &stream_maps[nb_stream_maps++];
|
m = &stream_maps[nb_stream_maps++];
|
||||||
|
|
||||||
m->file_index = strtol(arg, (char **)&p, 0);
|
m->file_index = strtol(arg, &p, 0);
|
||||||
if (*p)
|
if (*p)
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
m->stream_index = strtol(p, (char **)&p, 0);
|
m->stream_index = strtol(p, &p, 0);
|
||||||
if (*p) {
|
if (*p) {
|
||||||
p++;
|
p++;
|
||||||
m->sync_file_index = strtol(p, (char **)&p, 0);
|
m->sync_file_index = strtol(p, &p, 0);
|
||||||
if (*p)
|
if (*p)
|
||||||
p++;
|
p++;
|
||||||
m->sync_stream_index = strtol(p, (char **)&p, 0);
|
m->sync_stream_index = strtol(p, &p, 0);
|
||||||
} else {
|
} else {
|
||||||
m->sync_file_index = m->file_index;
|
m->sync_file_index = m->file_index;
|
||||||
m->sync_stream_index = m->stream_index;
|
m->sync_stream_index = m->stream_index;
|
||||||
@ -2568,16 +2568,15 @@ static void opt_map(const char *arg)
|
|||||||
static void opt_map_meta_data(const char *arg)
|
static void opt_map_meta_data(const char *arg)
|
||||||
{
|
{
|
||||||
AVMetaDataMap *m;
|
AVMetaDataMap *m;
|
||||||
const char *p;
|
char *p;
|
||||||
|
|
||||||
p = arg;
|
|
||||||
m = &meta_data_maps[nb_meta_data_maps++];
|
m = &meta_data_maps[nb_meta_data_maps++];
|
||||||
|
|
||||||
m->out_file = strtol(arg, (char **)&p, 0);
|
m->out_file = strtol(arg, &p, 0);
|
||||||
if (*p)
|
if (*p)
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
m->in_file = strtol(p, (char **)&p, 0);
|
m->in_file = strtol(p, &p, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int64_t parse_time_or_die(const char *timestr, int is_duration)
|
static int64_t parse_time_or_die(const char *timestr, int is_duration)
|
||||||
|
@ -3841,12 +3841,12 @@ static int parse_ffconfig(const char *filename)
|
|||||||
get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p);
|
get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p);
|
||||||
} else if (!strcasecmp(cmd, "FileMaxSize")) {
|
} else if (!strcasecmp(cmd, "FileMaxSize")) {
|
||||||
if (feed) {
|
if (feed) {
|
||||||
const char *p1;
|
char *p1;
|
||||||
double fsize;
|
double fsize;
|
||||||
|
|
||||||
get_arg(arg, sizeof(arg), &p);
|
get_arg(arg, sizeof(arg), &p);
|
||||||
p1 = arg;
|
p1 = arg;
|
||||||
fsize = strtod(p1, (char **)&p1);
|
fsize = strtod(p1, &p1);
|
||||||
switch(toupper(*p1)) {
|
switch(toupper(*p1)) {
|
||||||
case 'K':
|
case 'K':
|
||||||
fsize *= 1024;
|
fsize *= 1024;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user