From d6adaccf6d40c2bd67352c61dee93bf7ab0f3e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 1 Nov 2023 14:21:05 +0200 Subject: [PATCH] ptp: Check once a second for timeouts While the minimum timeout duration is 5s, checking only every 5s means that we would notice this 4.9s too late in the worst case. Checking once a second reduces this considerably while keeping the number of wakeups still low. Part-of: --- subprojects/gstreamer/libs/gst/net/gstptpclock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/gstreamer/libs/gst/net/gstptpclock.c b/subprojects/gstreamer/libs/gst/net/gstptpclock.c index 2089d5d3be..e863a929e3 100644 --- a/subprojects/gstreamer/libs/gst/net/gstptpclock.c +++ b/subprojects/gstreamer/libs/gst/net/gstptpclock.c @@ -2472,8 +2472,8 @@ ptp_helper_main (gpointer data) STDERR_MESSAGE_HEADER_SIZE, G_PRIORITY_DEFAULT, NULL, (GAsyncReadyCallback) have_stderr_header, NULL); - /* Check all 5 seconds, if we have to cleanup ANNOUNCE or pending syncs message */ - cleanup_source = g_timeout_source_new_seconds (5); + /* Check every 1 seconds, if we have to cleanup ANNOUNCE or pending syncs message */ + cleanup_source = g_timeout_source_new_seconds (1); g_source_set_priority (cleanup_source, G_PRIORITY_DEFAULT); g_source_set_callback (cleanup_source, (GSourceFunc) cleanup_cb, NULL, NULL); g_source_attach (cleanup_source, main_context);