Fix loading of LV2 effects that have Event ports (Calf Plugins)

The Calf plugin suite exposes Event ports which is currently not supported or defined in `liblilv`, so instead of flat rejecting the filter, test the port name for `Events` and allow them to load.
This commit is contained in:
Geoffrey McRae 2019-11-24 21:29:34 +00:00 committed by James Crook
parent af79017f3a
commit b3ade99a58
1 changed files with 16 additions and 1 deletions

View File

@ -432,7 +432,22 @@ bool LV2Effect::SetHost(EffectHostInterface *host)
if (!lilv_port_is_a(mPlug, port, gAudio) &&
!lilv_port_is_a(mPlug, port, gControl))
{
return false;
// There is no event port support in liblilv
// The workaround below tests for an event port, used
// for example in Calf plug-ins.
// We'll allow an event port, even though we won't use it.
// Otherwise we return false and reject the plug in.
LilvNode* name = lilv_port_get_name(mPlug, port);
if (!name)
return false;
if (strcmp(lilv_node_as_string(name), "Events") != 0)
{
lilv_node_free(name);
return false;
}
lilv_node_free(name);
}
}