13
0

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!
This commit is contained in:
Robin Gareus 2019-09-05 16:57:19 +02:00
parent cff4332bcb
commit 4949f9a0b3
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

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