summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-08-16 03:45:45 +0200
committerRobin Gareus <robin@gareus.org>2015-08-16 03:46:45 +0200
commitf65bcc6e74314adce53b6941785b783383c2d7ed (patch)
treeff06f9882899072c648abd3de230a245640badc1
parent9f3bf09a7ceea8b8ea33832bdb88f098d1bc5bfe (diff)
compat for old sessions with missing plugins (+doc)
-rw-r--r--libs/ardour/route.cc4
-rw-r--r--libs/ardour/unknown_processor.cc34
2 files changed, 37 insertions, 1 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index f461fe58d1..ce5570057b 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -1934,7 +1934,9 @@ Route::configure_processors_unlocked (ProcessorStreams* err)
list< pair<ChanCount,ChanCount> >::iterator c = configuration.begin();
for (ProcessorList::iterator p = _processors.begin(); p != _processors.end(); ++p, ++c) {
- (*p)->configure_io(c->first, c->second);
+ if (!(*p)->configure_io(c->first, c->second)) {
+ DEBUG_TRACE (DEBUG::Processors, string_compose ("%1: configuration failed\n", _name));
+ }
processor_max_streams = ChanCount::max(processor_max_streams, c->first);
processor_max_streams = ChanCount::max(processor_max_streams, c->second);
diff --git a/libs/ardour/unknown_processor.cc b/libs/ardour/unknown_processor.cc
index 4bf4ebeaef..df40d4d040 100644
--- a/libs/ardour/unknown_processor.cc
+++ b/libs/ardour/unknown_processor.cc
@@ -69,6 +69,40 @@ UnknownProcessor::can_support_io_configuration (const ChanCount &in, ChanCount &
if (have_ioconfig && in == *saved_input) {
out = *saved_output;
return true;
+ } else if (!have_ioconfig) {
+ /* pass for old sessions.
+ *
+ * session load assumes processor config succeeds.
+ * if initial configuration fails, processors downstream
+ * remain unconfigured and at least the panner will assert/segfault.
+ *
+ * This may still result in impossible setup, however
+ * Route::configure_processors_unlocked() ignores configure_io() return value
+ * in the inner loop and configures all available processors.
+ *
+ * It can still lead to segfaults IFF the track has no inputs and this is a
+ * generator (processor_max_streams will be zero).
+ */
+ PBD::warning << _("Using plugin-stub with unknown i/o configuration for: ") << name() << endmsg;
+#if 0
+ /* No output channels are fine (or should be, there may be edge-cases with e.g sends).
+ *
+ * Discussion needed.
+ *
+ * This is the safer option (no audio output, no possible damage)
+ * and the way to go in the long run.
+ * An even better solution is to disable the route if there are missing plugins
+ * and/or impossible configurations.
+ *
+ * Currently no output channels results in awkward GUI route display and also
+ * breaks semantics in mixbus (which assumes that the route has channels required
+ * for the always present mixer-strip plugin).
+ */
+ out = ChanCount ();
+#else
+ out = in;
+#endif
+ return true;
}
return false;
}