Updated A/V to new time function.

This commit is contained in:
irungentoo 2014-05-04 20:33:08 -04:00
parent fca5e1b99a
commit 8369ac98b0
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98
2 changed files with 5 additions and 4 deletions

View File

@ -27,6 +27,7 @@
#endif /* HAVE_CONFIG_H */
#include <stdlib.h>
#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;
}

View File

@ -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;