diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h index 8f06b62b4c..ec59cc4f14 100644 --- a/libs/ardour/ardour/lv2_plugin.h +++ b/libs/ardour/ardour/lv2_plugin.h @@ -255,7 +255,8 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee PORT_AUTOCTRL = 1 << 9, ///< Event port supports auto:AutomationControl PORT_CTRLED = 1 << 10, ///< Port prop auto:AutomationControlled (can be self controlled) PORT_CTRLER = 1 << 11, ///< Port prop auto:AutomationController (can be self set) - PORT_NOAUTO = 1 << 12 ///< Port don't allow to automate + PORT_NOAUTO = 1 << 12, ///< Port don't allow to automate + PORT_OTHOPT = 1 << 13 ///< Port of unknown data type with prop connectionOptional } PortFlag; typedef unsigned PortFlags; diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index c21229886a..1c9608e865 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -838,7 +838,9 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate) lilv_nodes_free(min_size_v); lilv_nodes_free(buffer_types); lilv_nodes_free(atom_supports); - } else if (!lilv_port_has_property(_impl->plugin, port, _world.lv2_connectionOptional)) { + } else if (lilv_port_has_property(_impl->plugin, port, _world.lv2_connectionOptional)) { + flags |= PORT_OTHOPT; // unknown data type but connection optional + } else { error << string_compose( "LV2: \"%1\" port %2 has no known data type", lilv_node_as_string(_impl->name), i) << endmsg; @@ -2994,6 +2996,8 @@ LV2Plugin::connect_and_run(BufferSet& bufs, } buf = lv2_evbuf_get_buffer(_ev_buffers[port_index]); + } else if(flags & PORT_OTHOPT) { + // Explicitely connect optional ports that we can not handle to NULL } else { continue; // Control port, leave buffer alone } @@ -3453,6 +3457,8 @@ LV2Plugin::latency_compute_run() ev_buffers.push_back (lv2_evbuf_new (buf_size, _uri_map.urids.atom_Chunk, _uri_map.urids.atom_Sequence)); void* buf = lv2_evbuf_get_buffer (ev_buffers.back ()); lilv_instance_connect_port(_impl->instance, port_index, buf); + } else if (flags & PORT_OTHOPT) { + lilv_instance_connect_port(_impl->instance, port_index, NULL); } } @@ -3974,7 +3980,7 @@ LV2PluginInfo::discover (boost::function