From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Wed, 26 May 2021 18:36:31 +0000 (+0100) Subject: remove redundant item X-Git-Tag: 4.1-dev~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4ba81ec5ffefddd4abc817dfdfdf55d9a45ef25;p=thirdparty%2Fshairport-sync.git remove redundant item --- diff --git a/player.h b/player.h index a7759c93..35a3db6e 100644 --- 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 d4f1e06a..d7ad5472 100644 --- 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();