summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-11-17 01:42:55 +0000
committerCarl Hetherington <carl@carlh.net>2009-11-17 01:42:55 +0000
commit16e5bd5ce7911326167b987d776b58177f09f4bd (patch)
tree23ce049857c21cae53a3433ceae8a7fa9cb3c7f3 /libs
parent6c21a54509e29bbd5d2d954b4f70b01aa144f84c (diff)
Non-ideal but functional fix for problems when adding processors which increase the required number of scratch buffers.
git-svn-id: svn://localhost/ardour2/branches/3.0@6105 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/route.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index e129a22d2c..24556308d9 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -1376,7 +1376,6 @@ Route::configure_processors_unlocked (ProcessorStreams* err)
_in_configure_processors = true;
-
// Check each processor in order to see if we can configure as requested
ChanCount in = _input->n_ports ();
ChanCount out;
@@ -1398,6 +1397,15 @@ Route::configure_processors_unlocked (ProcessorStreams* err)
}
}
+ /* Take the process lock so that if we add a processor which increases the required
+ number of scratch buffers, we create those scratch buffers before the process
+ thread has a chance to ask for them.
+ XXX: in an ideal world we'd perhaps use some RCU magic to avoid having to take
+ the lock here.
+ */
+
+ Glib::Mutex::Lock pl (_session.engine().process_lock ());
+
// We can, so configure everything
list< pair<ChanCount,ChanCount> >::iterator c = configuration.begin();
for (ProcessorList::iterator p = _processors.begin(); p != _processors.end(); ++p, ++c) {
@@ -1407,6 +1415,12 @@ Route::configure_processors_unlocked (ProcessorStreams* err)
out = c->second;
}
+ /* make sure we have sufficient scratch buffers to cope with the new processor
+ configuration */
+ _session.ensure_buffers (n_process_buffers ());
+
+ _session.ensure_buffers (n_process_buffers ());
+
_in_configure_processors = false;
return 0;
}
@@ -2741,7 +2755,8 @@ Route::set_block_size (nframes_t nframes)
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
(*i)->set_block_size (nframes);
}
- _session.ensure_buffers(processor_max_streams);
+
+ _session.ensure_buffers (n_process_buffers ());
}
void