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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5520>
This commit is contained in:
Sebastian Dröge 2023-11-01 14:21:05 +02:00 committed by GStreamer Marge Bot
parent 9ba8107ec6
commit d6adaccf6d

View file

@ -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);