]> granicus.if.org Git - handbrake/commitdiff
merge: muxavformat: add "creation_time" metadata
authorjstebbins <jstebbins.hb@gmail.com>
Sun, 15 Mar 2015 15:45:24 +0000 (15:45 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Sun, 15 Mar 2015 15:45:24 +0000 (15:45 +0000)
Tags mp4 files with current time.  This was previously done by mp4v2 for us.

git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.10.x@6992 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/muxavformat.c

index 814504c7d76ca3eb9369ac00688633cf736933d6..0ef018779a6e9a2fb4f312eae0a06b9daf26ac9c 100644 (file)
@@ -912,6 +912,11 @@ static int avformatInit( hb_mux_object_t * m )
     snprintf(tool_string, sizeof(tool_string), "HandBrake %s %i",
              HB_PROJECT_VERSION, HB_PROJECT_BUILD);
     av_dict_set(&m->oc->metadata, "encoding_tool", tool_string, 0);
+    time_t now = time(NULL);
+    struct tm * now_utc = gmtime(&now);
+    char now_8601[24];
+    strftime(now_8601, sizeof(now_8601), "%FT%TZ", now_utc);
+    av_dict_set(&m->oc->metadata, "creation_time", now_8601, 0);
 
     ret = avformat_write_header(m->oc, &av_opts);
     if( ret < 0 )