diff options
-rw-r--r-- | toxav/event.c | 7 | ||||
-rwxr-xr-x | toxav/rtp.c | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/toxav/event.c b/toxav/event.c index ffda35ec..35af98bb 100644 --- a/toxav/event.c +++ b/toxav/event.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #endif /* HAVE_CONFIG_H */ | 27 | #endif /* HAVE_CONFIG_H */ |
28 | 28 | ||
29 | #include <stdlib.h> | 29 | #include <stdlib.h> |
30 | #include "../toxcore/network.h" /* current_time_monotonic() */ | ||
30 | #include "event.h" | 31 | #include "event.h" |
31 | 32 | ||
32 | #define _GNU_SOURCE | 33 | #define _GNU_SOURCE |
@@ -199,7 +200,7 @@ void *event_poll( void *arg ) | |||
199 | 200 | ||
200 | if ( _event_handler->timed_events ) { | 201 | if ( _event_handler->timed_events ) { |
201 | 202 | ||
202 | uint32_t _time = ((uint32_t)(current_time() / 1000)); | 203 | uint32_t _time = ((uint32_t)current_time_monotonic()); |
203 | 204 | ||
204 | if ( _event_handler->timed_events[0].timeout < _time ) { | 205 | if ( _event_handler->timed_events[0].timeout < _time ) { |
205 | 206 | ||
@@ -249,7 +250,7 @@ int throw_timer_event ( void * (func)(void *), void *arg, unsigned timeout) | |||
249 | 250 | ||
250 | size_t _counter = event_handler.timed_events_count; | 251 | size_t _counter = event_handler.timed_events_count; |
251 | 252 | ||
252 | event_handler.timed_events[_counter - 1].timeout = timeout + ((uint32_t)(current_time() / 1000)); | 253 | event_handler.timed_events[_counter - 1].timeout = timeout + ((uint32_t)current_time_monotonic()); |
253 | event_handler.timed_events[_counter - 1].id = _unique_id; | 254 | event_handler.timed_events[_counter - 1].id = _unique_id; |
254 | ++_unique_id; | 255 | ++_unique_id; |
255 | 256 | ||
@@ -330,7 +331,7 @@ int reset_timer_event ( int id, uint32_t timeout ) | |||
330 | /* Find it and change */ | 331 | /* Find it and change */ |
331 | for ( ; _i; _i-- ) { | 332 | for ( ; _i; _i-- ) { |
332 | if ( _it->id == id ) { | 333 | if ( _it->id == id ) { |
333 | _it->timeout = timeout + ((uint32_t)(current_time() / 1000)); | 334 | _it->timeout = timeout + ((uint32_t)current_time_monotonic()); |
334 | break; | 335 | break; |
335 | } | 336 | } |
336 | 337 | ||
diff --git a/toxav/rtp.c b/toxav/rtp.c index 7307a168..9462a467 100755 --- a/toxav/rtp.c +++ b/toxav/rtp.c | |||
@@ -410,7 +410,7 @@ RTPHeader *build_header ( RTPSession *session ) | |||
410 | ADD_SETTING_PAYLOAD ( _retu, session->payload_type ); | 410 | ADD_SETTING_PAYLOAD ( _retu, session->payload_type ); |
411 | 411 | ||
412 | _retu->sequnum = session->sequnum; | 412 | _retu->sequnum = session->sequnum; |
413 | _retu->timestamp = ((uint32_t)(current_time() / 1000)); /* micro to milli */ | 413 | _retu->timestamp = current_time_monotonic(); /* milliseconds */ |
414 | _retu->ssrc = session->ssrc; | 414 | _retu->ssrc = session->ssrc; |
415 | 415 | ||
416 | int i; | 416 | int i; |