]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Quieten some more debug messages. Fix a misleading clock status return.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Mon, 10 May 2021 15:03:02 +0000 (16:03 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Mon, 10 May 2021 15:03:02 +0000 (16:03 +0100)
player.c
ptp-utilities.c
rtp.c
rtsp.c

index 69172e3f5924c95d99161d19404da8688f2885d3..db46cd124ae93e480c5e960d264217cf3a5125a8 100644 (file)
--- a/player.c
+++ b/player.c
@@ -1279,7 +1279,7 @@ static abuf_t *buffer_get_frame(rtsp_conn_info *conn) {
     if (do_wait == 0)
       if ((conn->ab_synced != 0) && (conn->ab_read == conn->ab_write)) { // the buffer is empty!
         if (notified_buffer_empty == 0) {
-          debug(1, "Buffers exhausted.");
+          debug(3, "Buffers exhausted.");
           notified_buffer_empty = 1;
           // reset_input_flow_metrics(conn); // don't do a full flush parameters reset
           conn->initial_reference_time = 0;
index 8dd412dc6489dbeb39c60646caef4bc38656f7b1..73b778fa947a8347d617e5a7cbac074188185381 100644 (file)
@@ -82,7 +82,11 @@ int ptp_get_clock_info(uint64_t *actual_clock_id, uint64_t *raw_offset) {
           response = clock_no_master;
         }
       } else {
-        response = clock_version_mismatch;
+        // the version can not be zero. If zero is returned here, it means that the shared memory is not yet initialised, so not availalbe
+        if (nqptp_data.version == 0)
+          response = clock_service_unavailable;
+        else
+          response = clock_version_mismatch;
       }
     } else {
       response = clock_data_unavailable;
diff --git a/rtp.c b/rtp.c
index 1cc3b084410fd69b202fd3c4effafc70b6030486..520e0c061b6893858984cc5f93434934418b4ed2 100644 (file)
--- 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 "
@@ -1413,12 +1413,9 @@ void *rtp_event_receiver(void *arg) {
       finished = 1;
     }
   } while (finished == 0);
-  debug(1, "Connection %d: AP2 Event Receiver RTP thread \"normal\" exit.",
-        conn->connection_number);
   pthread_cleanup_pop(1); // close the socket
-
   pthread_cleanup_pop(1); // do the cleanup
-  debug(1, "Connection %d: AP2 Event Receiver RTP thread exit.", conn->connection_number);
+  debug(2, "Connection %d: AP2 Event Receiver RTP thread \"normal\" exit.", conn->connection_number);
   pthread_exit(NULL);
 }
 
diff --git a/rtsp.c b/rtsp.c
index 3f216eeae67aed25620b76a9f7ab8943fdc83643..9ea485128508263a586e336a4bc70bf8d9e12e7d 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -379,7 +379,7 @@ int get_play_lock(rtsp_conn_info *conn) {
 #else
   } else if (config.allow_session_interruption == 1) {
 #endif
-    debug(1, "Connection %d: Asking Connection %d to stop playing.", conn->connection_number,
+    debug(2, "Connection %d: Asking Connection %d to stop playing.", conn->connection_number,
           playing_conn->connection_number);
     playing_conn->stop = 1;
     interrupting_current_session = 1;
@@ -406,7 +406,7 @@ int get_play_lock(rtsp_conn_info *conn) {
     }
 
     if ((have_the_player == 1) && (interrupting_current_session == 1)) {
-      debug(1, "Connection %d: got player lock", conn->connection_number);
+      debug(2, "Connection %d: Got player lock", conn->connection_number);
       response = 1;
     } else {
       debug(1, "Connection %d: failed to get player lock", conn->connection_number);
@@ -1398,7 +1398,7 @@ void handle_setrateanchori(rtsp_conn_info *conn, rtsp_message *req, rtsp_message
         debug(2, "Connection %d: Stop playing.", conn->connection_number);
         conn->ap2_play_enabled = 0;
         // not sure this is needed yet
-        reset_anchor_info(conn); // needed if the player resumes
+        // reset_anchor_info(conn); // needed if the player resumes
       }
       pthread_cleanup_pop(1); // unlock the conn->flush_mutex