mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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:
parent
c1b42827c1
commit
072fa3543e
1 changed files with 1 additions and 2 deletions
|
@ -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
|
/* convert clock time to NTP time. upper 32 bits should contain the seconds
|
||||||
* and the lower 32 bits, the fractions of a second. */
|
* and the lower 32 bits, the fractions of a second. */
|
||||||
ntptime = gst_util_uint64_scale (now, (G_GINT64_CONSTANT (1) << 32),
|
ntptime = gst_util_uint64_scale (now, (G_GINT64_CONSTANT (1) << 32), 1000000);
|
||||||
GST_USECOND);
|
|
||||||
/* conversion from UNIX timestamp (seconds since 1970) to NTP (seconds
|
/* conversion from UNIX timestamp (seconds since 1970) to NTP (seconds
|
||||||
* since 1900). */
|
* since 1900). */
|
||||||
ntptime += (G_GUINT64_CONSTANT (2208988800) << 32);
|
ntptime += (G_GUINT64_CONSTANT (2208988800) << 32);
|
||||||
|
|
Loading…
Reference in a new issue