]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Add warnings to tell us if the time info might overflow, quieten some debug messages...
authorMike Brady <mikebrady@eircom.net>
Wed, 11 Apr 2018 19:56:38 +0000 (20:56 +0100)
committerMike Brady <mikebrady@eircom.net>
Wed, 11 Apr 2018 19:56:38 +0000 (20:56 +0100)
common.c
rtp.c

index e942f1c0df1e402b2460e1edf5b10b6c2ce32bbb..e835ab6757291aa58bb4d9b862b50b666fd62a70 100644 (file)
--- 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 f402080433aeccb96c97398235c8fdb15261e311..e8dc5d7d5c9b6b44c0542a221047e02b5f2e8e44 100644 (file)
--- 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;