Handle Lua DSP script load failure (unknown plugin)

This handles a very specific edge-case: A script that was
successfully parsed before, fails load on session state restore.
This commit is contained in:
Robin Gareus 2019-11-01 15:49:46 +01:00
parent 7852047dca
commit a5140f4558
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
3 changed files with 7 additions and 3 deletions

View file

@ -199,6 +199,9 @@ LuaProc::lua_print (std::string s) {
bool
LuaProc::load_script ()
{
if (_script.empty ()) {
return true;
}
assert (!_lua_dsp); // don't allow to re-initialize
LuaPluginInfoPtr lpi;

View file

@ -250,7 +250,7 @@ ARDOUR::find_plugin(Session& session, string identifier, PluginType type)
}
#endif
return PluginPtr ((Plugin*) 0);
return PluginPtr ();
}
ChanCount

View file

@ -2656,8 +2656,9 @@ PluginInsert::set_state(const XMLNode& node, int version)
boost::shared_ptr<LuaProc> lp (new LuaProc (_session.engine(), _session, ""));
XMLNode *ls = node.child (lp->state_node_name().c_str());
if (ls && lp) {
lp->set_script_from_state (*ls);
plugin = lp;
if (0 == lp->set_script_from_state (*ls)) {
plugin = lp;
}
}
}