summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2011-02-11 15:29:56 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2011-02-19 00:01:29 +0100
commitbf0e167d157d12f9df463d224094d4ff8d1bf146 (patch)
treeb2632c3a469a6fcdabd2726869b9cf6f1a019330
parentf81010ebdaf5b8e489c19251572a05de7abe8320 (diff)
gtk: s/g_get_monotonic_clock/g_get_monotonic_time
-rw-r--r--gtk/spice-session.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index 57fa8fb..0bc0195 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -984,13 +984,13 @@ int spice_session_get_connection_id(SpiceSession *session)
return s->connection_id;
}
-#if !GLIB_CHECK_VERSION(2,28,0)
-static guint64 g_get_monotonic_clock(void)
+#if !GLIB_CHECK_VERSION(2,27,2)
+static guint64 g_get_monotonic_time(void)
{
GTimeVal tv;
/* TODO: support real monotonic clock? */
- g_get_current_time (&tv);
+ g_get_current_time(&tv);
return (((gint64) tv.tv_sec) * 1000000) + tv.tv_usec;
}
@@ -1003,7 +1003,9 @@ guint32 spice_session_get_mm_time(SpiceSession *session)
g_return_val_if_fail(s != NULL, 0);
- return s->mm_time + (g_get_monotonic_clock() - s->mm_time_at_clock) / 1000;
+ /* FIXME: we may want to estimate the drift of clocks, and well,
+ do something better than this trivial approach */
+ return s->mm_time + (g_get_monotonic_time() - s->mm_time_at_clock) / 1000;
}
G_GNUC_INTERNAL
@@ -1015,7 +1017,7 @@ void spice_session_set_mm_time(SpiceSession *session, guint32 time)
SPICE_DEBUG("set mm time: %u", time);
s->mm_time = time;
- s->mm_time_at_clock = g_get_monotonic_clock();
+ s->mm_time_at_clock = g_get_monotonic_time();
}
G_GNUC_INTERNAL