diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2007-09-19 12:38:07 +0000 |
---|---|---|
committer | Benoit Fouet <benoit.fouet@free.fr> | 2007-09-19 12:38:07 +0000 |
commit | f94361612a69bea8afb4dde4c17a98f8fd915244 (patch) | |
tree | 47731875dd54268671016b5c5387e5a2ae425580 /libavformat/utils.c | |
parent | 4ec45764a09b78e556e10cd65f2d2f5a57900990 (diff) | |
download | ffmpeg-f94361612a69bea8afb4dde4c17a98f8fd915244.tar.gz |
Make parse_date return INT64_MIN in case of unparsable input.
Patch by Stefano Sabatini: [stefano sabatini-lala poste it]
Original thread:
[FFmpeg-devel] [PATCH] Enhace documentation forlibavformat/utils.c:parse_date
Date: 08/17/2007 09:40 PM
Originally committed as revision 10533 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index b018de99d8..dcdd5f0108 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2621,6 +2621,9 @@ int64_t parse_date(const char *datestr, int duration) if (!q) { /* parse datestr as S+ */ dt.tm_sec = strtol(p, (char **)&q, 10); + if (q == p) + /* the parsing didn't succeed */ + return INT64_MIN; dt.tm_min = 0; dt.tm_hour = 0; } @@ -2628,10 +2631,7 @@ int64_t parse_date(const char *datestr, int duration) /* Now we have all the fields that we can get */ if (!q) { - if (duration) - return 0; - else - return now * INT64_C(1000000); + return INT64_MIN; } if (duration) { |