summaryrefslogtreecommitdiff
path: root/libs/ardour/disk_writer.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-09-05 16:57:19 +0200
committerRobin Gareus <robin@gareus.org>2019-09-05 16:57:19 +0200
commit4949f9a0b3f64a7a37fb6f45aa1cc5ade8542d0a (patch)
tree79935f1699e6f86b6e514d9502317fb2118ae80f /libs/ardour/disk_writer.cc
parentcff4332bcbb08662b7999df78bb6513b5b07b6c0 (diff)
Reset write-source only when necessary
When I/O port-counts do not change, plugin re-order happens in sync in the process-thread. ::configure_io() is only called to ensure that the current configuration is valid. In case that the ChanCount does not change, the method must be realtime-safe and not block. DiskWriter::reset_write_sources() is not realtime-safe and implicitly causes a session-save: Write-sources are destroyed and re-created. This includes a call to write_source->drop_references(), which triggers ARDOUR::Session::remove_source(), which saves the session. Furthermore adding/removing plugins will likewise call ::configure_io(). Previously any processor change on a track lead to saving the session!
Diffstat (limited to 'libs/ardour/disk_writer.cc')
-rw-r--r--libs/ardour/disk_writer.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/libs/ardour/disk_writer.cc b/libs/ardour/disk_writer.cc
index d93f8680bf..d9bf2fac1e 100644
--- a/libs/ardour/disk_writer.cc
+++ b/libs/ardour/disk_writer.cc
@@ -1497,11 +1497,25 @@ DiskWriter::steal_write_source_name ()
bool
DiskWriter::configure_io (ChanCount in, ChanCount out)
{
+ bool changed = false;
+ {
+ boost::shared_ptr<ChannelList> c = channels.reader();
+ if (in.n_audio() != c->size()) {
+ changed = true;
+ }
+ if ((0 == in.n_midi ()) != (0 == _midi_buf)) {
+ changed = true;
+ }
+ }
+
+
if (!DiskIOProcessor::configure_io (in, out)) {
return false;
}
- reset_write_sources (false, true);
+ if (record_enabled() || changed) {
+ reset_write_sources (false, true);
+ }
return true;
}