diff options
author | Robin Gareus <robin@gareus.org> | 2019-11-01 15:49:46 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-11-01 15:54:36 +0100 |
commit | a5140f45581951a5f70399d3a586987d3eccb3fd (patch) | |
tree | 9f6a7eb894f7abcb7044207704e0ec3ed14f6b67 | |
parent | 7852047dca6312a668edb1ba3fd0d315b3f83ac8 (diff) |
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.
-rw-r--r-- | libs/ardour/luaproc.cc | 3 | ||||
-rw-r--r-- | libs/ardour/plugin.cc | 2 | ||||
-rw-r--r-- | libs/ardour/plugin_insert.cc | 5 |
3 files changed, 7 insertions, 3 deletions
diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc index a4fde50186..e40127f7a5 100644 --- a/libs/ardour/luaproc.cc +++ b/libs/ardour/luaproc.cc @@ -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; diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc index c2a7be2774..b0964c2c16 100644 --- a/libs/ardour/plugin.cc +++ b/libs/ardour/plugin.cc @@ -250,7 +250,7 @@ ARDOUR::find_plugin(Session& session, string identifier, PluginType type) } #endif - return PluginPtr ((Plugin*) 0); + return PluginPtr (); } ChanCount diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 5ced715cd4..ba2346b72f 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -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; + } } } |