diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2015-04-06 01:45:37 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2015-04-07 12:36:11 +0200 |
commit | 27f274628234c1f934b9a6a6380ed567c1b4ceae (patch) | |
tree | 647efad34e75a371f43d71470c08eac773b4aa19 /libavformat/utils.c | |
parent | 108f2f381acb93827fb4add0517eeae859afa3bf (diff) | |
download | ffmpeg-27f274628234c1f934b9a6a6380ed567c1b4ceae.tar.gz |
parseutils: Make av_small_strptime public
And use it in libavformat.
Based on a similar patch by Stefano Sabatini <stefasab@gmail.com>.
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 6248c1e5cb..c275d06df4 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2902,21 +2902,14 @@ int ff_find_stream_index(AVFormatContext *s, int id) int64_t ff_iso8601_to_unix_time(const char *datestr) { -#if HAVE_STRPTIME struct tm time1 = { 0 }, time2 = { 0 }; char *ret1, *ret2; - ret1 = strptime(datestr, "%Y - %m - %d %T", &time1); - ret2 = strptime(datestr, "%Y - %m - %dT%T", &time2); + ret1 = av_small_strptime(datestr, "%Y - %m - %d %T", &time1); + ret2 = av_small_strptime(datestr, "%Y - %m - %dT%T", &time2); if (ret2 && !ret1) return av_timegm(&time2); else return av_timegm(&time1); -#else - av_log(NULL, AV_LOG_WARNING, - "strptime() unavailable on this system, cannot convert " - "the date string.\n"); - return 0; -#endif } int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id, |