]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
remove redundant item
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 26 May 2021 18:36:31 +0000 (19:36 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 26 May 2021 18:36:31 +0000 (19:36 +0100)
player.h
rtp.c

index a7759c933155d55279ad885c33e0521ac1367419..35a3db6e5bfe2fd0030bda232a59e33052150f1b 100644 (file)
--- a/player.h
+++ b/player.h
@@ -292,7 +292,6 @@ typedef struct {
   uint32_t last_anchor_rtptime;
   uint64_t last_anchor_local_time;
   uint64_t last_anchor_time_of_update;
-  uint64_t last_anchor_clock;
 
   ssize_t ap2_audio_buffer_size;
   int ap2_flush_requested;
diff --git a/rtp.c b/rtp.c
index d4f1e06a6c7166322fe58e803a69f2a3bf5b933b..d7ad5472582fbf3c05ecae20436c555e2e89b5b4 100644 (file)
--- a/rtp.c
+++ b/rtp.c
@@ -1243,10 +1243,12 @@ int get_ptp_anchor_local_time_info(rtsp_conn_info *conn, uint32_t *anchorRTP,
 
       if (actual_clock_id == conn->anchor_clock) {
         // if the master clock and the anchor clock are the same
+        // wait at least this time before using the new master clock
         if (duration_of_mastership < 700000000) {
           response = clock_not_ready;
         } else if ((duration_of_mastership > 5000000000) || (conn->last_anchor_info_is_valid == 0)) {
-          conn->last_anchor_clock = conn->anchor_clock;
+          // use the master clock if it's at least this old or we have no alternative
+          // and at least it is the minimum age.
           conn->last_anchor_rtptime = conn->anchor_rtptime;
           conn->last_anchor_local_time = conn->anchor_time - actual_offset;
           conn->last_anchor_time_of_update = get_absolute_time_in_ns();