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.
This commit is contained in:
Robin Gareus 2017-04-27 19:43:34 +02:00
parent 410f94cf1b
commit c25640f336

View File

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