From 9405f3df6361be0e188ba4a764244ebab06f7ff9 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 15 Apr 2025 08:08:59 -0400 Subject: [PATCH] MT#55283 convert timestamp/check to int64_t Change-Id: If669a04aff9e24ee3b4775e4e7c7ba6c006f0445 --- daemon/call.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 09aa720ca..f92f04ff2 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -124,7 +124,7 @@ void call_make_own_foreign(call_t *c, bool foreign) { /* called with hashlock held */ static void call_timer_iterator(call_t *c, struct iterator_helper *hlp) { - unsigned int check; + int64_t check; bool good = false; bool do_update = false; bool has_srtp = false; @@ -132,7 +132,7 @@ static void call_timer_iterator(call_t *c, struct iterator_helper *hlp) { stream_fd *sfd; int tmp_t_reason = UNKNOWN; enum call_stream_state css; - uint64_t timestamp; + int64_t timestamp; hlp->count++; @@ -182,7 +182,7 @@ static void call_timer_iterator(call_t *c, struct iterator_helper *hlp) { for (__auto_type it = c->streams.head; it; it = it->next) { ps = it->data; - timestamp = packet_stream_last_packet(ps) / 1000000L; + timestamp = packet_stream_last_packet(ps); if (!ps->media) goto next; @@ -195,7 +195,7 @@ static void call_timer_iterator(call_t *c, struct iterator_helper *hlp) { css = call_stream_state_machine(ps); if (css == CSS_ICE) - timestamp = atomic64_get_na(&ps->media->ice_agent->last_activity) / 1000000; // XXX + timestamp = atomic64_get_na(&ps->media->ice_agent->last_activity); if (PS_ISSET(ps, RTP)) { if (rtpe_now - atomic64_get_na(&ps->stats_in->last_packet_us) < 2000000LL) { @@ -237,18 +237,18 @@ no_sfd: if (good) goto next; - check = atomic_get_na(&rtpe_config.timeout); + check = atomic_get_na(&rtpe_config.timeout) * 1000000L; // XXX scale to micro tmp_t_reason = TIMEOUT; if (!MEDIA_ISSET(ps->media, RECV) || !sfd) { - check = atomic_get_na(&rtpe_config.silent_timeout); + check = atomic_get_na(&rtpe_config.silent_timeout) * 1000000L; // XXX scale to micro tmp_t_reason = SILENT_TIMEOUT; } else if (!PS_ISSET(ps, FILLED)) { - check = atomic_get_na(&rtpe_config.offer_timeout); + check = atomic_get_na(&rtpe_config.offer_timeout) * 1000000L; // XXX scale to micro tmp_t_reason = OFFER_TIMEOUT; } - if (timestamp > timeval_from_us(rtpe_now).tv_sec || timeval_from_us(rtpe_now).tv_sec - timestamp < check) + if (timestamp > rtpe_now || rtpe_now - timestamp < check) good = true; next: