This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 2bbf0da31a3311a4b6498ff3e0d4b408817758ed
Author:     Marton Balint <[email protected]>
AuthorDate: Sun Jun 14 01:34:09 2026 +0200
Commit:     Marton Balint <[email protected]>
CommitDate: Wed Jun 24 23:31:53 2026 +0200

    avformat/asfdec_o: use common function for setting creation time
    
    This also increases precision.
    
    Signed-off-by: Marton Balint <[email protected]>
---
 libavformat/asfdec_o.c | 25 +++----------------------
 1 file changed, 3 insertions(+), 22 deletions(-)

diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index dd022cb404..f3d3d06891 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -19,15 +19,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <time.h>
-
 #include "libavutil/attributes.h"
 #include "libavutil/common.h"
 #include "libavutil/dict.h"
 #include "libavutil/internal.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/mem.h"
-#include "libavutil/time_internal.h"
 
 #include "avformat.h"
 #include "avlanguage.h"
@@ -534,31 +531,15 @@ static int asf_read_properties(AVFormatContext *s, const 
GUIDParseTable *g)
 {
     ASFContext *asf = s->priv_data;
     AVIOContext *pb = s->pb;
-    time_t creation_time;
+    int64_t creation_time;
 
     avio_rl64(pb); // read object size
     avio_skip(pb, 16); // skip File ID
     avio_skip(pb, 8);  // skip File size
     creation_time = avio_rl64(pb);
     if (!(asf->b_flags & ASF_FLAG_BROADCAST)) {
-        struct tm tmbuf;
-        struct tm *tm;
-        char buf[64];
-
-        // creation date is in 100 ns units from 1 Jan 1601, conversion to s
-        creation_time /= 10000000;
-        // there are 11644473600 seconds between 1 Jan 1601 and 1 Jan 1970
-        creation_time -= 11644473600;
-        tm = gmtime_r(&creation_time, &tmbuf);
-        if (tm) {
-            if (!strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm))
-                buf[0] = '\0';
-        } else
-            buf[0] = '\0';
-        if (buf[0]) {
-            if (av_dict_set(&s->metadata, "creation_time", buf, 0) < 0)
-                av_log(s, AV_LOG_WARNING, "av_dict_set failed.\n");
-        }
+        if (ff_dict_set_timestamp(&s->metadata, "creation_time", 
ff_asf_filetime_to_avtime(creation_time)) < 0)
+            av_log(s, AV_LOG_WARNING, "av_dict_set failed.\n");
     }
     asf->nb_packets  = avio_rl64(pb);
     asf->duration    = avio_rl64(pb) / 10000; // stream duration

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to