From f796537ef3c0653a3dcc1990ce4c3d3998f4a257 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 15 Apr 2025 12:12:32 -0400 Subject: [PATCH] MT#55283 simplify ntp_ts_lsw, ntp_ts_msw Change-Id: I33d72c8ef2b6832378c92902fc9bc253d325ace3 --- daemon/ssrc.c | 9 ++++++--- include/ssrc.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/daemon/ssrc.c b/daemon/ssrc.c index 7e101f9d6..69d291f26 100644 --- a/daemon/ssrc.c +++ b/daemon/ssrc.c @@ -317,7 +317,8 @@ static void *__do_time_report_item(struct call_media *m, size_t struct_size, siz sti = g_malloc0(struct_size); sti->received = tv; sti->ntp_middle_bits = ntp_msw << 16 | ntp_lsw >> 16; - sti->ntp_ts = ntp_ts_to_double(ntp_msw, ntp_lsw); + sti->ntp_ts_lsw = ntp_lsw; + sti->ntp_ts_msw = ntp_msw; e = get_ssrc(ssrc, &m->ssrc_hash); if (G_UNLIKELY(!e)) { @@ -431,7 +432,8 @@ void ssrc_sender_report(struct call_media *m, const struct ssrc_sender_report *s ilog(LOG_DEBUG, "SR from %s%x%s: RTP TS %u PC %u OC %u NTP TS %u/%u=%f", FMT_M(sr->ssrc), sr->timestamp, sr->packet_count, sr->octet_count, - sr->ntp_msw, sr->ntp_lsw, seri->time_item.ntp_ts); + sr->ntp_msw, sr->ntp_lsw, + ntp_ts_to_double(seri->time_item.ntp_ts_msw, seri->time_item.ntp_ts_lsw)); mutex_unlock(&e->lock); obj_put(e); @@ -563,7 +565,8 @@ void ssrc_receiver_rr_time(struct call_media *m, const struct ssrc_xr_rr_time *r ilog(LOG_DEBUG, "XR RR TIME from %s%x%s: NTP TS %u/%u=%f", FMT_M(rr->ssrc), - rr->ntp_msw, rr->ntp_lsw, srti->time_item.ntp_ts); + rr->ntp_msw, rr->ntp_lsw, + ntp_ts_to_double(srti->time_item.ntp_ts_msw, srti->time_item.ntp_ts_lsw)); mutex_unlock(&e->lock); obj_put(e); diff --git a/include/ssrc.h b/include/ssrc.h index 4244b97ea..ee54ce6e3 100644 --- a/include/ssrc.h +++ b/include/ssrc.h @@ -114,7 +114,7 @@ enum ssrc_dir { // these values must not be used externally struct ssrc_time_item { int64_t received; uint32_t ntp_middle_bits; // to match up with lsr/dlrr - double ntp_ts; // XXX convert to int? + int32_t ntp_ts_lsw, ntp_ts_msw; }; struct ssrc_sender_report { uint32_t ssrc;