summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2016-06-30 00:55:48 +0200
committerMarton Balint <cus@passwd.hu>2016-08-28 15:55:32 +0200
commit13b90ff2c12749aac58d22da4cb47c24b7a37b04 (patch)
tree37e6a2d24cd32a4a89f99cbaffa49bffcc1db594 /libavformat/mov.c
parentfecf5ae9aa7499280e62f5244dfd2b65c92f532a (diff)
avformat: fix decoded creation_time timestamps
Use proper ISO 8601 timestamps which also signal that they are in UTC. This changes the format of creation_time and modification_date metadata values from 2016-06-01 22:30:00 to 2016-01-01T22:30:00.000000Z Fixes ticket #5673. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index bc11fb8ce0..6282d8f409 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1156,17 +1156,10 @@ static int mov_read_moof(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static void mov_metadata_creation_time(AVDictionary **metadata, int64_t time)
{
- char buffer[32];
if (time) {
- struct tm *ptm, tmbuf;
- time_t timet;
if(time >= 2082844800)
time -= 2082844800; /* seconds between 1904-01-01 and Epoch */
- timet = time;
- ptm = gmtime_r(&timet, &tmbuf);
- if (!ptm) return;
- if (strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", ptm))
- av_dict_set(metadata, "creation_time", buffer, 0);
+ avpriv_dict_set_timestamp(metadata, "creation_time", time * 1000000);
}
}