From 4b5e9787b78c4b7141882c0db028649a244af337 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Sun, 30 May 2021 12:04:06 +0100 Subject: [PATCH] Log information when anchor or master clock changes occur. --- rtp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rtp.c b/rtp.c index a4994301..a78c16e1 100644 --- a/rtp.c +++ b/rtp.c @@ -290,8 +290,8 @@ void *rtp_control_receiver(void *arg) { obfp += 2; }; *obfp = 0; - - + + // get raw timestamp information // I think that a good way to understand these timestamps is that // (1) the rtlt below is the timestamp of the frame that should be playing at the @@ -302,19 +302,19 @@ void *rtp_control_receiver(void *arg) { // Thus, (3) the latency can be calculated by subtracting the second from the // first. // There must be more to it -- there something missing. - + // In addition, it seems that if the value of the short represented by the second // pair of bytes in the packet is 7 // then an extra time lag is expected to be added, presumably by // the AirPort Express. - + // Best guess is that this delay is 11,025 frames. - + uint32_t rtlt = nctohl(&packet[4]); // raw timestamp less latency uint32_t rt = nctohl(&packet[16]); // raw timestamp - + uint32_t fl = nctohs(&packet[2]); // - + debug(1,"Sync Packet of %d bytes received: \"%s\", flags: %d, timestamps %u and %u, giving a latency of %d frames.",plen,obf,fl,rt,rtlt,rt-rtlt); //debug(1,"Monotonic timestamps are: %" PRId64 " and %" PRId64 " @@ -1257,7 +1257,7 @@ int get_ptp_anchor_local_time_info(rtsp_conn_info *conn, uint32_t *anchorRTP, conn->last_anchor_time_of_update = get_absolute_time_in_ns(); conn->last_anchor_info_is_valid = 1; if (conn->anchor_clock_is_new != 0) - debug(2, "Connection %d: New anchor clock %" PRIx64 " recognised.", + debug(1, "Connection %d: New anchor clock %" PRIx64 " recognised.", conn->connection_number, conn->anchor_clock); conn->anchor_clock_is_new = 0; } @@ -1299,7 +1299,7 @@ int get_ptp_anchor_local_time_info(rtsp_conn_info *conn, uint32_t *anchorRTP, if ((clock_status_t)response != conn->clock_status) { switch (response) { case clock_ok: - debug(2, "Connection %d: NQPTP new master clock %" PRIx64 ".", conn->connection_number, + debug(1, "Connection %d: NQPTP new master clock %" PRIx64 ".", conn->connection_number, actual_clock_id); break; case clock_not_ready: