]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/movenc.c
Merge commit '9752d2e6cc9b9e8070ec515db8ed8374683d0856'
[ffmpeg] / libavformat / movenc.c
index adde4b2c23093fcd0f9eb7c7c474a30d99dd09a9..42529ecd5af05ff970455a8e13844f3289dd8e7b 100644 (file)
@@ -2573,7 +2573,7 @@ static int mov_write_track_udta_tag(AVIOContext *pb, MOVMuxContext *mov,
     int ret, size;
     uint8_t *buf;
 
-    if (!st || mov->fc->flags & AVFMT_FLAG_BITEXACT)
+    if (!st)
         return 0;
 
     ret = avio_open_dyn_buf(&pb_buf);
@@ -2919,9 +2919,10 @@ static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov,
     mov_write_string_metadata(s, pb, "\251wrt", "composer" , 1);
     mov_write_string_metadata(s, pb, "\251alb", "album"    , 1);
     mov_write_string_metadata(s, pb, "\251day", "date"     , 1);
-    if (!mov->exact &&
-        !mov_write_string_metadata(s, pb, "\251too", "encoding_tool", 1))
-        mov_write_string_tag(pb, "\251too", LIBAVFORMAT_IDENT, 0, 1);
+    if (!mov_write_string_metadata(s, pb, "\251too", "encoding_tool", 1)) {
+        if (!(s->flags & AVFMT_FLAG_BITEXACT))
+            mov_write_string_tag(pb, "\251too", LIBAVFORMAT_IDENT, 0, 1);
+    }
     mov_write_string_metadata(s, pb, "\251cmt", "comment"  , 1);
     mov_write_string_metadata(s, pb, "\251gen", "genre"    , 1);
     mov_write_string_metadata(s, pb, "\251cpy", "copyright", 1);
@@ -5247,8 +5248,13 @@ static int mov_write_header(AVFormatContext *s)
         mov_write_mdat_tag(pb, mov);
     }
 
-    if (t = av_dict_get(s->metadata, "creation_time", NULL, 0))
+    if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) {
         mov->time = ff_iso8601_to_unix_time(t->value);
+        if (mov->time < 0) {
+            av_log(s, AV_LOG_WARNING, "Failed to parse creation_time %s\n", t->value);
+            mov->time = 0;
+        }
+    }
     if (mov->time)
         mov->time += 0x7C25B080; // 1970 based -> 1904 based