summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-11-17 02:44:33 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-11-17 02:44:33 +0100
commit8709ba907a7f6f44e392161221d9628fa74b22f6 (patch)
tree027c6658a2d564cf9c8d2150fd5f14633e9e4d65 /libavformat/utils.c
parent4f7ad4c3e460a7dfe4e3186c73ad73db29336488 (diff)
parent268fb3f9851590aed724dba83d3999c8369c929f (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: mpegaudiodec: Don't use a nonexistent log context for av_dlog avformat: Accept the ISO8601 separate format as input, too avformat: Interpret times in ff_iso8601_to_unix_time as UTC avutil: Add av_timegm as a public function cinepak: Add another special case so that it can handle the following file: lagarith: add some RGBA decoding support lagarith: Add correct line prediction for RGB Conflicts: doc/APIchanges libavcodec/cinepak.c libavutil/avutil.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index ab063fa796..1906b27536 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -33,6 +33,7 @@
#include "id3v2.h"
#include "libavutil/avstring.h"
#include "libavutil/mathematics.h"
+#include "libavutil/parseutils.h"
#include "riff.h"
#include "audiointerleave.h"
#include "url.h"
@@ -4161,9 +4162,14 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
int64_t ff_iso8601_to_unix_time(const char *datestr)
{
#if HAVE_STRPTIME
- struct tm time = {0};
- strptime(datestr, "%Y - %m - %dT%T", &time);
- return mktime(&time);
+ 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);
+ 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");