summaryrefslogtreecommitdiff
path: root/libs/ardour/audioengine.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-01-27 20:26:06 +0100
committerRobin Gareus <robin@gareus.org>2020-01-27 20:26:06 +0100
commit44440f93163c02c1a217c2a28cbcd7c84ac3b148 (patch)
treedba125cc028ba12e816f5af3a3e70badce61a041 /libs/ardour/audioengine.cc
parent5c789547cb1a951ba2c29fcd4fc4d9dcec87533c (diff)
Add new requirements from AudioEngine::stop to ::drop_backend
This fixes an issue that after changing backends (::set_backend), the session-transport was in inconsistent state. If it was rolling, it continued to roll with "stop" being unavailable.
Diffstat (limited to 'libs/ardour/audioengine.cc')
-rw-r--r--libs/ardour/audioengine.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index 1fcf285437..7f4dbdfa5a 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -896,12 +896,22 @@ void
AudioEngine::drop_backend ()
{
if (_backend) {
+ /* see also ::stop() */
_backend->stop ();
- // Stopped is needed for Graph to explicitly terminate threads
+ _running = false;
+ if (_session && !_session->loading() && !_session->deletion_in_progress()) {
+ // 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 ();
+ }
+ Port::PortDrop (); /* EMIT SIGNAL */
+ TransportMasterManager& tmm (TransportMasterManager::instance());
+ tmm.engine_stopped ();
+
+ /* Stopped is needed for Graph to explicitly terminate threads */
Stopped (); /* EMIT SIGNAL */
_backend->drop_device ();
_backend.reset ();
- _running = false;
}
}