From c25640f3364478e91c135936644f264f143f1f43 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 27 Apr 2017 19:43:34 +0200 Subject: [PATCH] Fix flow for latency measurements that needs an engine stop. Make AudioEngine::prepare_for_latency_measurement() idempotent. There are multple calls (when switching to the measurement page and every time a measurement is preformed). Also the Stopped() signal is important for the Dialog state regardless if the engine was stopped for latency or not. --- libs/ardour/audioengine.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 96445b5973..1a09a7f0eb 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -956,7 +956,7 @@ AudioEngine::stop (bool for_latency) Port::PortDrop (); } - if (!for_latency && stop_engine) { + if (stop_engine) { Stopped (); /* EMIT SIGNAL */ } @@ -1331,6 +1331,10 @@ AudioEngine::prepare_for_latency_measurement () return -1; } + if (running() && _started_for_latency) { + return 0; + } + if (_backend->can_change_systemic_latency_when_running()) { if (start()) { return -1;