[FFmpeg-devel] [PATCH] avformat/mov: remove hack breaking creation time parsing

Marton Balint cus at passwd.hu
Sat Apr 8 21:37:24 EEST 2023


Commit 23eeffcd48a15e73fb2649b712870b6d101c5471 added a hack to support invalid
files where the creation date was encoded as a classic unix timestamp. This
broke however valid files having creation dates before the unix epoch.

Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavformat/mov.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 057fd872b1..7748bdc041 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1518,8 +1518,7 @@ static int mov_read_moof(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 static void mov_metadata_creation_time(AVDictionary **metadata, int64_t time, void *logctx)
 {
     if (time) {
-        if (time >= 2082844800)
-            time -= 2082844800;  /* seconds between 1904-01-01 and Epoch */
+        time -= 2082844800;  /* seconds between 1904-01-01 and Epoch */
 
         if ((int64_t)(time * 1000000ULL) / 1000000 != time) {
             av_log(logctx, AV_LOG_DEBUG, "creation_time is not representable\n");
-- 
2.35.3



More information about the ffmpeg-devel mailing list