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)
This commit is contained in:
Edward Hervey 2014-06-12 11:55:59 +02:00
parent c1b42827c1
commit 072fa3543e

View file

@ -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);