diff --git a/src/transports/janus_http.c b/src/transports/janus_http.c index bce5f1f15a..7448c09d7c 100644 --- a/src/transports/janus_http.c +++ b/src/transports/janus_http.c @@ -258,7 +258,7 @@ static GSource *janus_http_request_timeout_create(janus_transport_session *ts, j janus_http_request_timeout *t = (janus_http_request_timeout *)source; t->ts = ts; t->session = session; - g_source_set_ready_time(source, janus_get_monotonic_time() + timeout*G_USEC_PER_SEC); + g_source_set_ready_time(source, janus_get_monotonic_time_internal() + timeout*G_USEC_PER_SEC); JANUS_LOG(LOG_DBG, "[%p] create (%d)\n", source, timeout); return source; } diff --git a/src/utils.c b/src/utils.c index 409a0cc50b..f4ffee9d1d 100644 --- a/src/utils.c +++ b/src/utils.c @@ -31,7 +31,7 @@ #include "mach_gettime.h" #endif -static gint64 janus_get_monotonic_time_internal(void) { +gint64 janus_get_monotonic_time_internal(void) { struct timespec ts; clock_gettime (CLOCK_MONOTONIC, &ts); return (ts.tv_sec*G_GINT64_CONSTANT(1000000)) + (ts.tv_nsec/G_GINT64_CONSTANT(1000)); diff --git a/src/utils.h b/src/utils.h index 6bb68981e1..895572d82d 100644 --- a/src/utils.h +++ b/src/utils.h @@ -43,6 +43,11 @@ struct janus_json_parameter { /*! Helper method used by the core to mark when Janus started */ void janus_mark_started(void); +/*! \brief Helper to retrieve the system monotonic time, as Glib's + * g_get_monotonic_time may not be available (only since 2.28) + * @returns The system monotonic time */ +gint64 janus_get_monotonic_time_internal(void); + /*! \brief Helper to retrieve the system monotonic time, as Glib's * g_get_monotonic_time may not be available (only since 2.28) * @note The monotonic time will be normalized from the Janus start time