Skip to content
Browse files

mov: fix time types related to mov_metadata_creation_time

Fixes Ticket1817
Based on patch by: Przemyslaw Wesolek <przemyslaw.wesolek@go.art.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit adbb75dbd8eabdaa7439633d26a79eb5b7387ef9)

From ffmpeg 97ec20a20aded201f1ef6b78559f58b984bdee39
Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>
  • Loading branch information...
1 parent da78e80 commit 16c178de4ebb31d622c5a534844bf02ca8d66045 @michaelni michaelni committed with jyavenard
Showing with 6 additions and 4 deletions.
  1. +6 −4 mythtv/external/FFmpeg/libavformat/mov.c
View
10 mythtv/external/FFmpeg/libavformat/mov.c
@@ -778,14 +778,16 @@ static int mov_read_moof(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return mov_read_default(c, pb, atom);
}
-static void mov_metadata_creation_time(AVDictionary **metadata, time_t time)
+static void mov_metadata_creation_time(AVDictionary **metadata, int64_t time)
{
char buffer[32];
if (time) {
struct tm *ptm;
+ time_t timet;
if(time >= 2082844800)
time -= 2082844800; /* seconds between 1904-01-01 and Epoch */
- ptm = gmtime(&time);
+ timet = time;
+ ptm = gmtime(&timet);
if (!ptm) return;
strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", ptm);
av_dict_set(metadata, "creation_time", buffer, 0);
@@ -799,7 +801,7 @@ static int mov_read_mdhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int version;
char language[4] = {0};
unsigned lang;
- time_t creation_time;
+ int64_t creation_time;
if (c->fc->nb_streams < 1)
return 0;
@@ -834,7 +836,7 @@ static int mov_read_mdhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
- time_t creation_time;
+ int64_t creation_time;
int version = avio_r8(pb); /* version */
avio_rb24(pb); /* flags */

0 comments on commit 16c178d

Please sign in to comment.
Something went wrong with that request. Please try again.