diff options
author | David Robillard <d@drobilla.net> | 2019-08-18 19:59:30 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-08-18 19:59:30 +0200 |
commit | 01426de7afd04e8a00c6d2fdd25893da83f70180 (patch) | |
tree | 4845a8e85017934d2b7e1a127e89618232305446 /src | |
parent | 1bce600a6f308b3bd836f85eb1cc62d3c93a5f35 (diff) | |
download | lilv-01426de7afd04e8a00c6d2fdd25893da83f70180.tar.gz lilv-01426de7afd04e8a00c6d2fdd25893da83f70180.tar.bz2 lilv-01426de7afd04e8a00c6d2fdd25893da83f70180.zip |
Fix lilv_plugin_get_latency_port_index() for lv2:latency designation
Diffstat (limited to 'src')
-rw-r--r-- | src/plugin.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugin.c b/src/plugin.c index b2648dd..e1567f4 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -731,10 +731,19 @@ lilv_plugin_get_port_by_designation(const LilvPlugin* plugin, LILV_API uint32_t lilv_plugin_get_latency_port_index(const LilvPlugin* plugin) { + LilvNode* lv2_OutputPort = + lilv_new_uri(plugin->world, LV2_CORE__OutputPort); + LilvNode* lv2_latency = + lilv_new_uri(plugin->world, LV2_CORE__latency); + const LilvPort* prop_port = lilv_plugin_get_port_by_property( plugin, plugin->world->uris.lv2_reportsLatency); - const LilvPort* des_port = lilv_plugin_get_port_by_property( - plugin, plugin->world->uris.lv2_latency); + const LilvPort* des_port = lilv_plugin_get_port_by_designation( + plugin, lv2_OutputPort, lv2_latency); + + lilv_node_free(lv2_latency); + lilv_node_free(lv2_OutputPort); + if (prop_port) { return prop_port->index; } else if (des_port) { |