summaryrefslogtreecommitdiff
path: root/libs/ardour/audioengine.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-06-21 15:00:10 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-06-21 15:00:10 +0000
commit8c87102688c06409850b6c7543a17932117a7a94 (patch)
treeaf17b3b21a09c58aa21d24cfb6eb1a9bc23732b6 /libs/ardour/audioengine.cc
parent83941f9988c5eef8ac86f180978547b1259ce095 (diff)
a putatively better approach to cleaning up ports at session closing
git-svn-id: svn://localhost/ardour2/branches/3.0@12807 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audioengine.cc')
-rw-r--r--libs/ardour/audioengine.cc24
1 files changed, 15 insertions, 9 deletions
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index 26f8311c8d..5642db8932 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -479,6 +479,21 @@ AudioEngine::process_callback (pframes_t nframes)
/* perform the actual session removal */
_session = 0;
session_remove_pending = false;
+
+ /* pump one cycle of silence into the ports
+ before the session tears them all down
+ (asynchronously).
+ */
+
+ boost::shared_ptr<Ports> p = ports.reader();
+
+ for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
+
+ if (i->second->sends_output()) {
+ i->second->get_buffer (nframes).silence (nframes);
+ }
+ }
+
session_removed.signal();
}
@@ -486,15 +501,6 @@ AudioEngine::process_callback (pframes_t nframes)
if (!_freewheeling) {
MIDI::Manager::instance()->cycle_start(nframes);
MIDI::Manager::instance()->cycle_end();
-
- boost::shared_ptr<Ports> p = ports.reader();
-
- for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
-
- if (i->second->sends_output()) {
- i->second->get_buffer (nframes).silence (nframes);
- }
- }
}
_processed_frames = next_processed_frames;