]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
store the latency so that the resend requst timing computations can be done correctly...
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Sat, 1 May 2021 10:49:24 +0000 (11:49 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Sat, 1 May 2021 10:49:24 +0000 (11:49 +0100)
rtp.c

diff --git a/rtp.c b/rtp.c
index 59cea3fab5f0536b665248bfdea37a23d6a917df..88628ebf4fbe5fa5798e07c5a1bcd946d2b2b416 100644 (file)
--- a/rtp.c
+++ b/rtp.c
@@ -1497,6 +1497,8 @@ void *rtp_ap2_control_receiver(void *arg) {
           // add in the audio_backend_latency_offset;
           int32_t notified_latency = frame_2 - frame_1;
           int32_t added_latency = (int32_t)(config.audio_backend_latency_offset * conn->input_rate);
+          // the actual latency is the notified latency plus the fixed latency + the added latency
+
           if (added_latency < (-(notified_latency + 11035)))
             debug(1, "the audio_backend_latency_offset is causing a negative latency!");
 
@@ -1507,7 +1509,9 @@ void *rtp_ap2_control_receiver(void *arg) {
               frame_1 - 11035 - added_latency; // add the latency in to the anchortime
           debug_mutex_unlock(&conn->reference_time_mutex, 0);
           */
-
+          // this is now only used for calculating when to ask for resends
+          conn->latency = notified_latency + 11035 + added_latency;
+          // debug(1,"conn->latency is %d.", conn->latency);
           set_ptp_anchor_info(conn, clock_id, frame_1 - 11035 - added_latency, remote_packet_time_ns);
 
         } break;