aboutsummaryrefslogtreecommitdiffstats
path: root/cmdutils.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2008-03-31 10:01:06 +0000
committerRobert Swain <robert.swain@gmail.com>2008-03-31 10:01:06 +0000
commit7542157d8afdf63a2cbc20a5e8aab86c85c42773 (patch)
tree3df705179d2d1cf8195f043079714bc66f9bb467 /cmdutils.c
parent2ccf0a42903e55d23588b2bc477bee0cf66a46dc (diff)
downloadffmpeg-7542157d8afdf63a2cbc20a5e8aab86c85c42773.tar.gz
Export parse_time_or_die from ffmpeg.c to cmdutils.c
Patch by Stefano Sabatini (stefano sabatini-lala poste it) Originally committed as revision 12647 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'cmdutils.c')
-rw-r--r--cmdutils.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmdutils.c b/cmdutils.c
index 36508d25b4..3eb9c18ecd 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -52,6 +52,17 @@ double parse_number_or_die(const char *context, const char *numstr, int type, do
exit(1);
}
+int64_t parse_time_or_die(const char *context, const char *timestr, int is_duration)
+{
+ int64_t us = parse_date(timestr, is_duration);
+ if (us == INT64_MIN) {
+ fprintf(stderr, "Invalid %s specification for %s: %s\n",
+ is_duration ? "duration" : "date", context, timestr);
+ exit(1);
+ }
+ return us;
+}
+
void show_help_options(const OptionDef *options, const char *msg, int mask, int value)
{
const OptionDef *po;