summaryrefslogtreecommitdiff
path: root/libs/ardour/audioengine.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2018-10-17 13:15:52 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2018-10-17 13:15:52 -0400
commit70c0e34c4dd272ef6d4a08938c64067c19af5d06 (patch)
treec273d930137cdfbbcea73885dc2eb270e1ecf572 /libs/ardour/audioengine.cc
parent05d35395916f6d00f230ddd64ee0abbea3b5a09c (diff)
when calling Session::engine_halted() after a user-driven engine stop, make sure Engine::running() will be false
Diffstat (limited to 'libs/ardour/audioengine.cc')
-rw-r--r--libs/ardour/audioengine.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index 91f58d44ad..ba4dc4348a 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -968,7 +968,13 @@ AudioEngine::stop (bool for_latency)
pl.release ();
}
- if (_session && _running && stop_engine &&
+ const bool was_running_will_stop = (_running && stop_engine);
+
+ if (was_running_will_stop) {
+ _running = false;
+ }
+
+ if (_session && was_running_will_stop &&
(_session->state_of_the_state() & Session::Loading) == 0 &&
(_session->state_of_the_state() & Session::Deletion) == 0) {
// it's not a halt, but should be handled the same way:
@@ -976,8 +982,7 @@ AudioEngine::stop (bool for_latency)
_session->engine_halted ();
}
- if (stop_engine && _running) {
- _running = false;
+ if (was_running_will_stop) {
if (!for_latency) {
_started_for_latency = false;
} else if (!_started_for_latency) {