From 072fa3543eae53b889c35fd32e00c7b5c1c58df6 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 12 Jun 2014 11:55:59 +0200 Subject: [PATCH] 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) --- gst-libs/gst/sdp/gstmikey.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gst-libs/gst/sdp/gstmikey.c b/gst-libs/gst/sdp/gstmikey.c index ecd3df9bfe..19093bdba4 100644 --- a/gst-libs/gst/sdp/gstmikey.c +++ b/gst-libs/gst/sdp/gstmikey.c @@ -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);