diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2010-11-23 12:04:50 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2010-11-23 12:04:50 +0000 |
commit | 73d0e33102f2bd38ff4ef810c26c1dc39888bd0b (patch) | |
tree | 07fffd27bf104443b3e08c6a93045e628aaee326 /libavformat/avidec.c | |
parent | d35cdd57194a7d30658739e36962d564d0d3f0db (diff) | |
download | ffmpeg-73d0e33102f2bd38ff4ef810c26c1dc39888bd0b.tar.gz |
avidec: support non-standard creation_time format
Originally committed as revision 25815 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r-- | libavformat/avidec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 1094d62b5b..66c58d921e 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -288,13 +288,17 @@ static void avi_metadata_creation_time(AVMetadata **metadata, char *date) int i, day, year; /* parse standard AVI date format (ie. "Mon Mar 10 15:04:43 2003") */ if (sscanf(date, "%*3s%*[ ]%3s%*[ ]%2d%*[ ]%8s%*[ ]%4d", - month, &day, time, &year) == 4) + month, &day, time, &year) == 4) { for (i=0; i<12; i++) if (!strcasecmp(month, months[i])) { snprintf(buffer, sizeof(buffer), "%.4d-%.2d-%.2d %s", year, i+1, day, time); av_metadata_set2(metadata, "creation_time", buffer, 0); } + } else if (date[4] == '/' && date[7] == '/') { + date[4] = date[7] = '-'; + av_metadata_set2(metadata, "creation_time", date, 0); + } } static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) |