13
0

Fix strict-i/o override on session-load (amend 31847f88ef)

Plugins may override strict-i/o, and in order to know do this
the plugin needs to be instantiate first.
This commit is contained in:
Robin Gareus 2019-10-23 01:21:42 +02:00
parent 496e6f2a4c
commit 7060ba4c1d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -3081,11 +3081,6 @@ Route::set_processor_state (XMLNode const & node, XMLProperty const* prop, Proce
} else {
processor.reset (new PluginInsert (_session));
processor->set_owner (this);
if (_strict_io) {
boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert>(processor);
pi->set_strict_io (true);
}
}
} else if (prop->value() == "port") {
@ -3108,8 +3103,14 @@ Route::set_processor_state (XMLNode const & node, XMLProperty const* prop, Proce
processor.reset (new UnknownProcessor (_session, node));
}
/* subscribe to Sidechain IO changes */
/* set strict I/O only after loading plugin state, because
* individual plugins may override this */
boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (processor);
if (pi && _strict_io) {
pi->set_strict_io (true);
}
/* subscribe to Sidechain IO changes */
if (pi && pi->has_sidechain ()) {
pi->sidechain_input ()->changed.connect_same_thread (*this, boost::bind (&Route::sidechain_change_handler, this, _1, _2));
}