From: Mike Brady Date: Wed, 11 Apr 2018 19:56:38 +0000 (+0100) Subject: Add warnings to tell us if the time info might overflow, quieten some debug messages... X-Git-Tag: 3.2RC3~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d392f75c1c37d2ea4a7757e935ea3ac48cabec95;p=thirdparty%2Fshairport-sync.git Add warnings to tell us if the time info might overflow, quieten some debug messages in rtp. --- diff --git a/common.c b/common.c index e942f1c0..e835ab67 100644 --- a/common.c +++ b/common.c @@ -795,7 +795,11 @@ uint64_t get_absolute_time_in_fp() { // can't use CLOCK_MONOTONIC_RAW as it's not implemented in OpenWrt clock_gettime(CLOCK_MONOTONIC, &tn); uint64_t tnfpsec = tn.tv_sec; + if (tnfpsec>0x100000000) + warn("clock_gettime seconds overflow!"); uint64_t tnfpnsec = tn.tv_nsec; + if (tnfpnsec>0x100000000) + warn("clock_gettime nanoseconds seconds overflow!"); tnfpsec = tnfpsec<<32; tnfpnsec = tnfpnsec<<32; tnfpnsec = tnfpnsec/1000000000; diff --git a/rtp.c b/rtp.c index f4020804..e8dc5d7d 100644 --- a/rtp.c +++ b/rtp.c @@ -134,7 +134,7 @@ void *rtp_audio_receiver(void *arg) { if (type == 0x56) { pktp += 4; plen -= 4; - debug(1, "resent packet %u received in audio port.", ntohs(*(uint16_t *)(pktp + 2))); + debug(3,"resent packet %u received in audio port.",ntohs(*(uint16_t *)(pktp + 2))); } seq_t seqno = ntohs(*(uint16_t *)(pktp + 2)); // increment last_seqno and see if it's the same as the incoming seqno @@ -347,22 +347,21 @@ void *rtp_control_receiver(void *arg) { } } else { uint8_t type = packet[1] & ~0x80; - if ((type == 0x60) || - (type == 0x56)) { // audio data / resent audio data in the control path -- whaale only? + if ((type == 0x60) || (type == 0x56)) { // audio data / resent audio data in the control path -- whaale only? pktp = packet; - + if (type == 0x56) { // resent audio data in the control path -- whaale only? // debug(1, "Control Port -- Retransmitted Audio Data Packet received."); pktp = packet + 4; plen -= 4; - } - + } + seq_t seqno = ntohs(*(uint16_t *)(pktp + 2)); - if (type == 0x56) - debug(1, "Resent audio packet %u received in the control port.", seqno); + if (type==0x56) + debug(3,"Resent audio packet %u received in the control port.",seqno); else - debug(1, "Audio packet %u received in the control port.", seqno); - + debug(1,"Audio packet %u received in the control port.",seqno); + int64_t timestamp = monotonic_timestamp(ntohl(*(uint32_t *)(pktp + 4)), conn); pktp += 12;