summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-04-04 17:57:18 +0000
committerCarl Hetherington <carl@carlh.net>2011-04-04 17:57:18 +0000
commit806b94bec1a8c43a1d2f42b5af6b235699339b2f (patch)
treedd94b7a594d45aec54385a6e2f761aad9827bed3
parent040e016137ff15ebfa446f7e1de321d17be45dcd (diff)
Add plugins (activating them) after doing any latency_compute_run, as otherwise the latency_compute_run deactivates the plugins and an assert trips in LadspaPlugin::run_in_place.
git-svn-id: svn://localhost/ardour2/branches/3.0@9282 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/ardour/plugin_insert.cc29
1 files changed, 17 insertions, 12 deletions
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc
index 71205c2c74..4666421b77 100644
--- a/libs/ardour/plugin_insert.cc
+++ b/libs/ardour/plugin_insert.cc
@@ -875,6 +875,23 @@ PluginInsert::set_state(const XMLNode& node, int version)
sscanf (prop->value().c_str(), "%u", &count);
}
+ /* Handle the node list for this Processor (or Insert if an A2 session).
+ * This needs to happen before the add_plugin_with_activation below, as
+ * the plugin set_state calls may themselves call latency_compute_run,
+ * which will leave the plugin deactivated whether it is currently
+ * activated or not.
+ */
+ for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
+
+ if ((*niter)->name() == plugin->state_node_name()) {
+
+ for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
+ (*i)->set_state (**niter, version);
+ }
+ break;
+ }
+ }
+
if (_plugins.size() != count) {
add_plugin_with_activation (plugin);
@@ -889,18 +906,6 @@ PluginInsert::set_state(const XMLNode& node, int version)
set_control_ids (node, version);
}
- /* Handle the node list for this Processor (or Insert if an A2 session) */
- for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
- if ((*niter)->name() == plugin->state_node_name()) {
-
- for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
- (*i)->set_state (**niter, version);
- }
- break;
- }
- }
-
if (version < 3000) {
/* Only 2.X sessions need a call to set_parameter_state() - in 3.X and above