summaryrefslogtreecommitdiff
path: root/libs/ardour/audioengine.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/audioengine.cc')
-rw-r--r--libs/ardour/audioengine.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index de41caae46..f277deaea6 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -770,7 +770,7 @@ void
AudioEngine::drop_backend ()
{
if (_backend) {
- stop(false);
+ _backend->stop ();
_backend->drop_device ();
_backend.reset ();
_running = false;
@@ -858,18 +858,20 @@ AudioEngine::stop (bool for_latency)
return 0;
}
- if (_session && _running) {
- // it's not a halt, but should be handled the same way:
- // disable record, stop transport and I/O processign but save the data.
- _session->engine_halted ();
- }
-
Glib::Threads::Mutex::Lock lm (_process_lock);
if (_backend->stop ()) {
return -1;
}
+ if (_session && _running &&
+ (_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:
+ // disable record, stop transport and I/O processign but save the data.
+ _session->engine_halted ();
+ }
+
_running = false;
_processed_frames = 0;
_measuring_latency = MeasureNone;