]> git.ipfire.org Git - thirdparty/nqptp.git/commitdiff
Continue to experiment with late follow-up correction weights.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Mon, 6 Dec 2021 18:48:38 +0000 (18:48 +0000)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Mon, 6 Dec 2021 18:48:38 +0000 (18:48 +0000)
nqptp-message-handlers.c

index fafb3a40565eaee67a719d105aba48702fec50c0..9eeaeeddc52a04a7227ec8aa2c2980fe5aae6ab8 100644 (file)
@@ -388,9 +388,13 @@ void handle_follow_up(char *buf, __attribute__((unused)) ssize_t recv_len,
 
       if (jitter > -10000000) {
         // we take any positive or a limited negative jitter as a sync event
-        if (jitter < 0)
-          offset = clock_private_info->previous_offset + jitter / 32;
-        else if (clock_private_info->follow_up_number <
+        if (jitter < 0) {
+          if (clock_private_info->follow_up_number <
+                 (5 * 8)) // at the beginning (8 samples per second)
+            offset = clock_private_info->previous_offset + jitter / 16;
+          else
+            offset = clock_private_info->previous_offset + jitter / 16;            
+        } else if (clock_private_info->follow_up_number <
                  (5 * 8)) // at the beginning (8 samples per second)
           offset =
               clock_private_info->previous_offset + jitter / 2; // accept positive changes quickly