diff utils.c @ 5807:f4ca0041b4f4 libavformat

Make the ntp_time function available to other parts of libavformat, as ff_ntp_time
author mstorsjo
date Wed, 10 Mar 2010 22:21:39 +0000
parents 821155aecf2a
children 2997c88028cd
line wrap: on
line diff
--- a/utils.c	Wed Mar 10 14:26:15 2010 +0000
+++ b/utils.c	Wed Mar 10 22:21:39 2010 +0000
@@ -3073,6 +3073,14 @@
     return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
 }
 
+#define NTP_OFFSET 2208988800ULL
+#define NTP_OFFSET_US (NTP_OFFSET * 1000000ULL)
+
+uint64_t ff_ntp_time(void)
+{
+  return (av_gettime() / 1000) * 1000 + NTP_OFFSET_US;
+}
+
 int64_t parse_date(const char *datestr, int duration)
 {
     const char *p;