From 03aa65af234a4da6c0422406ac567ce2e88753c7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 18 Dec 2020 21:45:22 +0100 Subject: Ignore ports with nonsense lv2:control designations --- src/jalv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/jalv.c b/src/jalv.c index 8f90ed3..9fc221e 100644 --- a/src/jalv.c +++ b/src/jalv.c @@ -238,7 +238,14 @@ jalv_create_ports(Jalv* jalv) const LilvPort* control_input = lilv_plugin_get_port_by_designation( jalv->plugin, jalv->nodes.lv2_InputPort, jalv->nodes.lv2_control); if (control_input) { - jalv->control_in = lilv_port_get_index(jalv->plugin, control_input); + const uint32_t index = lilv_port_get_index(jalv->plugin, control_input); + if (jalv->ports[index].type == TYPE_EVENT) { + jalv->control_in = index; + } else { + fprintf(stderr, + "warning: Non-event port %u has lv2:control designation, " + "ignored\n"); + } } free(default_values); -- cgit v1.2.1