mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Provide a context to parse_time_or_die().
Patch by Stefano Sabatini: stefano sabatini-lala poste it Originally committed as revision 12472 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
08e89160e4
commit
972d628a8b
14
ffmpeg.c
14
ffmpeg.c
@ -2580,12 +2580,12 @@ static void opt_map_meta_data(const char *arg)
|
|||||||
m->in_file = strtol(p, &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 *context, const char *timestr, int is_duration)
|
||||||
{
|
{
|
||||||
int64_t us = parse_date(timestr, is_duration);
|
int64_t us = parse_date(timestr, is_duration);
|
||||||
if (us == INT64_MIN) {
|
if (us == INT64_MIN) {
|
||||||
fprintf(stderr, "Invalid %s specification: %s\n",
|
fprintf(stderr, "Invalid %s specification for %s: %s\n",
|
||||||
is_duration ? "duration" : "date", timestr);
|
is_duration ? "duration" : "date", context, timestr);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
return us;
|
return us;
|
||||||
@ -2593,22 +2593,22 @@ static int64_t parse_time_or_die(const char *timestr, int is_duration)
|
|||||||
|
|
||||||
static void opt_recording_time(const char *arg)
|
static void opt_recording_time(const char *arg)
|
||||||
{
|
{
|
||||||
recording_time = parse_time_or_die(arg, 1);
|
recording_time = parse_time_or_die("t", arg, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void opt_start_time(const char *arg)
|
static void opt_start_time(const char *arg)
|
||||||
{
|
{
|
||||||
start_time = parse_time_or_die(arg, 1);
|
start_time = parse_time_or_die("ss", arg, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void opt_rec_timestamp(const char *arg)
|
static void opt_rec_timestamp(const char *arg)
|
||||||
{
|
{
|
||||||
rec_timestamp = parse_time_or_die(arg, 0) / 1000000;
|
rec_timestamp = parse_time_or_die("timestamp", arg, 0) / 1000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void opt_input_ts_offset(const char *arg)
|
static void opt_input_ts_offset(const char *arg)
|
||||||
{
|
{
|
||||||
input_ts_offset = parse_time_or_die(arg, 1);
|
input_ts_offset = parse_time_or_die("itsoffset", arg, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
|
static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
|
||||||
|
Loading…
Reference in New Issue
Block a user