diff options
author | David Robillard <d@drobilla.net> | 2009-06-03 21:47:19 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-06-03 21:47:19 +0000 |
commit | 3ee5e87fc15363c104f08e61ba8ed0da76f97152 (patch) | |
tree | 983ddefeeb5194e0a86887244c6b12ddba38ab1d /src/plugininstance.c | |
parent | c220a3ce918293855ed6b53b97dc604573fd031a (diff) | |
download | lilv-3ee5e87fc15363c104f08e61ba8ed0da76f97152.tar.gz lilv-3ee5e87fc15363c104f08e61ba8ed0da76f97152.tar.bz2 lilv-3ee5e87fc15363c104f08e61ba8ed0da76f97152.zip |
Consistent error/warning message output.
Fix crash on invalid plugin files.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2086 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/plugininstance.c')
-rw-r--r-- | src/plugininstance.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/plugininstance.c b/src/plugininstance.c index 26fd503..2089951 100644 --- a/src/plugininstance.c +++ b/src/plugininstance.c @@ -53,14 +53,14 @@ slv2_plugin_instantiate(SLV2Plugin plugin, dlerror(); void* lib = dlopen(lib_path, RTLD_NOW); if (!lib) { - fprintf(stderr, "Unable to open library %s (%s)\n", lib_path, dlerror()); + SLV2_ERRORF("Unable to open library %s (%s)\n", lib_path, dlerror()); return NULL; } LV2_Descriptor_Function df = dlsym(lib, "lv2_descriptor"); if (!df) { - fprintf(stderr, "Could not find symbol 'lv2_descriptor', " + SLV2_ERRORF("Could not find symbol 'lv2_descriptor', " "%s is not a LV2 plugin.\n", lib_path); dlclose(lib); return NULL; @@ -71,24 +71,17 @@ slv2_plugin_instantiate(SLV2Plugin plugin, const char* bundle_path = slv2_uri_to_path(slv2_value_as_uri( slv2_plugin_get_bundle_uri(plugin))); - //printf("Bundle path: %s\n", bundle_path); - for (uint32_t i=0; 1; ++i) { const LV2_Descriptor* ld = df(i); if (!ld) { - fprintf(stderr, "Did not find plugin %s in %s\n", + SLV2_ERRORF("Did not find plugin %s in %s\n", slv2_value_as_uri(slv2_plugin_get_uri(plugin)), lib_path); dlclose(lib); break; // return NULL } else if (!strcmp(ld->URI, slv2_value_as_uri(slv2_plugin_get_uri(plugin)))) { - assert(plugin->plugin_uri); - - //printf("Found %s at index %u in:\n\t%s\n\n", - // librdf_uri_as_string(plugin->plugin_uri), i, lib_path); - assert(ld->instantiate); // Create SLV2Instance to return @@ -110,7 +103,6 @@ slv2_plugin_instantiate(SLV2Plugin plugin, // Failed to instantiate if (result->lv2_handle == NULL) { - //printf("Failed to instantiate %s\n", plugin->plugin_uri); free(result); return NULL; } |