ocount++;
}
- if (icount == 0 || ocount == 0)
+ if (ocount == 0)
return FALSE;
return TRUE;
int err;
/* open the object file */
- dl_handle = dlopen (filename, RTLD_NOW|RTLD_GLOBAL);
+ dl_handle = dlopen (filename, RTLD_NOW);
if (!dl_handle)
{
- mlt_log_warning( NULL, "%s: error opening shared object file '%s': %s\n",
+ mlt_log_info( NULL, "%s: error opening shared object file '%s': %s\n",
__FUNCTION__, filename, dlerror());
return;
}
dlerr = dlerror();
if (dlerr) {
- mlt_log_warning( NULL, "%s: error finding ladspa_descriptor symbol in object file '%s': %s\n",
+ mlt_log_info( NULL, "%s: error finding ladspa_descriptor symbol in object file '%s': %s\n",
__FUNCTION__, filename, dlerr);
dlclose (dl_handle);
return;
}
+#ifdef __DARWIN__
+ if (!get_descriptor (0)) {
+ void (*constructor)(void) = dlsym (dl_handle, "_init");
+ if (constructor) constructor();
+ }
+#endif
+
plugin_index = 0;
while ( (descriptor = get_descriptor (plugin_index)) )
{
char * ladspa_path, * dir;
ladspa_path = g_strdup (getenv ("LADSPA_PATH"));
- if (!ladspa_path)
#ifdef WIN32
- ladspa_path = g_strdup ("lib\\ladspa");
+ if (!ladspa_path)
+ {
+ ladspa_path = malloc (strlen (mlt_environment("MLT_APPDIR")) + strlen ("\\lib\\ladspa") + 1);
+ strcpy (ladspa_path, mlt_environment("MLT_APPDIR"));
+ strcat (ladspa_path, "\\lib\\ladspa");
+ }
+#elif defined(__DARWIN__) && defined(RELOCATABLE)
+ {
+ ladspa_path = malloc( strlen (mlt_environment ("MLT_APPDIR")) + strlen ("/lib/ladspa") + 1 );
+ strcpy (ladspa_path, mlt_environment ("MLT_APPDIR"));
+ strcat (ladspa_path, "/lib/ladspa" );
+ }
#else
+ if (!ladspa_path)
ladspa_path = g_strdup ("/usr/local/lib/ladspa:/usr/lib/ladspa:/usr/lib64/ladspa");
#endif
- dir = strtok (ladspa_path, ":");
- do
+ for (dir = strtok (ladspa_path, ":"); dir; dir = strtok (NULL, ":"))
plugin_mgr_get_dir_plugins (plugin_mgr, dir);
- while ((dir = strtok (NULL, ":")));
g_free (ladspa_path);
}
plugin_mgr_get_path_plugins (pm);
if (!pm->all_plugins)
- {
- mlt_log_warning( NULL, "No LADSPA plugins were found!\n\nCheck your LADSPA_PATH environment variable.\n");
- abort ();
- }
-
- pm->all_plugins = g_slist_sort (pm->all_plugins, plugin_mgr_sort);
+ mlt_log_warning( NULL, "No LADSPA plugins were found!\n\nCheck your LADSPA_PATH environment variable.\n");
+ else
+ pm->all_plugins = g_slist_sort (pm->all_plugins, plugin_mgr_sort);
return pm;
}