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.
This commit is contained in:
Robin Gareus 2020-01-27 20:26:06 +01:00
parent 5c789547cb
commit 44440f9316
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

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