diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-05-13 11:01:37 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-06-29 14:18:14 -0400 |
commit | 2911bb9fb88818624983cbbfb7f8aa594e98fb14 (patch) | |
tree | 56fd95c1be72df07360f31fe1fececb09ea080f8 /libs | |
parent | 289078f7f8224ec72fb23d81b0e2b53a09611cfa (diff) |
AudioEngine tweaks from Tracks, related to stopping audioengine and halting
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/audioengine.cc | 16 |
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; |