aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/matroskadec.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/matroskadec.c
parentfecf5ae9aa7499280e62f5244dfd2b65c92f532a (diff)
downloadffmpeg-13b90ff2c12749aac58d22da4cb47c24b7a37b04.tar.gz
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/matroskadec.c')
-rw-r--r--libavformat/matroskadec.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index d07a0920cf..77b8a5d5ed 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1691,13 +1691,8 @@ static int matroska_aac_sri(int samplerate)
static void matroska_metadata_creation_time(AVDictionary **metadata, int64_t date_utc)
{
- char buffer[32];
/* Convert to seconds and adjust by number of seconds between 2001-01-01 and Epoch */
- time_t creation_time = date_utc / 1000000000 + 978307200;
- struct tm tmpbuf, *ptm = gmtime_r(&creation_time, &tmpbuf);
- 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", date_utc / 1000 + 978307200000000LL);
}
static int matroska_parse_flac(AVFormatContext *s,