From 8369ac98b09e262731a42d8beafa4b403606ee25 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sun, 4 May 2014 20:33:08 -0400 Subject: [PATCH] Updated A/V to new time function. --- toxav/event.c | 7 ++++--- 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 @@ #endif /* HAVE_CONFIG_H */ #include +#include "../toxcore/network.h" /* current_time_monotonic() */ #include "event.h" #define _GNU_SOURCE @@ -199,7 +200,7 @@ void *event_poll( void *arg ) if ( _event_handler->timed_events ) { - uint32_t _time = ((uint32_t)(current_time() / 1000)); + uint32_t _time = ((uint32_t)current_time_monotonic()); if ( _event_handler->timed_events[0].timeout < _time ) { @@ -249,7 +250,7 @@ int throw_timer_event ( void * (func)(void *), void *arg, unsigned timeout) size_t _counter = event_handler.timed_events_count; - event_handler.timed_events[_counter - 1].timeout = timeout + ((uint32_t)(current_time() / 1000)); + event_handler.timed_events[_counter - 1].timeout = timeout + ((uint32_t)current_time_monotonic()); event_handler.timed_events[_counter - 1].id = _unique_id; ++_unique_id; @@ -330,7 +331,7 @@ int reset_timer_event ( int id, uint32_t timeout ) /* Find it and change */ for ( ; _i; _i-- ) { if ( _it->id == id ) { - _it->timeout = timeout + ((uint32_t)(current_time() / 1000)); + _it->timeout = timeout + ((uint32_t)current_time_monotonic()); break; } 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 ) ADD_SETTING_PAYLOAD ( _retu, session->payload_type ); _retu->sequnum = session->sequnum; - _retu->timestamp = ((uint32_t)(current_time() / 1000)); /* micro to milli */ + _retu->timestamp = current_time_monotonic(); /* milliseconds */ _retu->ssrc = session->ssrc; int i;