Commit 072fa354 authored by Edward Hervey's avatar Edward Hervey 🤘

mikey: Fix Wall to NTP conversion

We are scaling from a unit in microseconds to a unit in ((1 << 32) per seconds).

We therefore scale the microseconds values by:

         value of a second in the target unit (1 << 32)
  --------------------------------------------------------------
  value of a second in the origin format (1 000 000 microsecond)
parent c1b42827
......@@ -1271,8 +1271,7 @@ gst_mikey_message_add_t_now_ntp_utc (GstMIKEYMessage * msg)
/* convert clock time to NTP time. upper 32 bits should contain the seconds
* and the lower 32 bits, the fractions of a second. */
ntptime = gst_util_uint64_scale (now, (G_GINT64_CONSTANT (1) << 32),
GST_USECOND);
ntptime = gst_util_uint64_scale (now, (G_GINT64_CONSTANT (1) << 32), 1000000);
/* conversion from UNIX timestamp (seconds since 1970) to NTP (seconds
* since 1900). */
ntptime += (G_GUINT64_CONSTANT (2208988800) << 32);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment