From 09f9cd377d4e70e8e88c1fae24cb1a4fe40d1080 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 27 Apr 2020 16:31:40 +0200 Subject: [PATCH] Prevent excessive latency recomputations Session::update_latency() may be called multiple times with the process-lock being held. --- libs/ardour/session.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 1ec274b917..d422555666 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -7020,6 +7020,9 @@ Session::auto_connect_thread_run () */ while (g_atomic_int_and (&_latency_recompute_pending, 0)) { update_latency_compensation (true, false); + if (g_atomic_int_get (&_latency_recompute_pending)) { + Glib::usleep (1000); + } } }