From 23eeffcd48a15e73fb2649b712870b6d101c5471 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 1 Jul 2012 21:41:06 +0200 Subject: [PATCH] mov: add workaround for incorrect 0 time point. Fixes Ticket1471 Signed-off-by: Michael Niedermayer --- libavformat/mov.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index af5b126261..faa8c65246 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -780,7 +780,8 @@ static void mov_metadata_creation_time(AVDictionary **metadata, time_t time) char buffer[32]; if (time) { struct tm *ptm; - time -= 2082844800; /* seconds between 1904-01-01 and Epoch */ + if(time >= 2082844800) + time -= 2082844800; /* seconds between 1904-01-01 and Epoch */ ptm = gmtime(&time); if (!ptm) return; strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", ptm);