On Thu, 2007-12-13 at 09:03 +0100, [EMAIL PROTECTED] wrote: > Hello, > > I've installed the slv2 package on my machine but can't run any plugins? > > When I start > > lv2_jack_host > > get lots of known plugins URI's like > > http://ll-plugins.nongnu.org/lv2/dev/klaviatur/0.0.0 > > > which I want to run. > > But when I start I get > > lv2_jack_host http://ll-plugins.nongnu.org/lv2/dev/klaviatur/0.0.0 > Failed to find plugin http://ll-plugins.nongnu.org/lv2/dev/klaviatur/0.0.0.
This is the way you're supposed to run it, but for some reason it won't find the plugin. I looked at the code and it seems like it tries to do a binary search in an unsorted array, the attached patch should fix it. --ll
Index: src/plugins.c
===================================================================
--- src/plugins.c (revision 971)
+++ src/plugins.c (working copy)
@@ -71,27 +71,19 @@
SLV2Plugin
slv2_plugins_get_by_uri(SLV2Plugins list, const char* uri)
{
- // good old fashioned binary search
+ // good old fashioned linear search
- int lower = 0;
int upper = raptor_sequence_size(list) - 1;
int i;
- while (upper >= lower) {
- i = lower + ((upper - lower) / 2);
-
+ for (i = 0; i <= upper; ++i) {
+
SLV2Plugin p = raptor_sequence_get_at(list, i);
-
- const int cmp = strcmp(slv2_plugin_get_uri(p), uri);
-
- if (cmp == 0)
+
+ if (!strcmp(slv2_plugin_get_uri(p), uri))
return p;
- else if (cmp > 0)
- upper = i - 1;
- else
- lower = i + 1;
}
-
+
return NULL;
}
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Linux-audio-dev mailing list [email protected] http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
