ladspa: Don't try and load every file as a plugin
When scanning paths for LADSPA plugins, don't try and load
every random file as a module, as g_module_open ends up throwing
errors on Windows.
Use a G_MODULE_SUFFIX and GST_EXTRA_MODULE_SUFFIX suffix check as
we do for GStreamer plugins.
https://bugzilla.gnome.org/show_bug.cgi?id=796450
diff --git a/ext/ladspa/gstladspa.c b/ext/ladspa/gstladspa.c
index 87b7b60..e04e4bb 100644
--- a/ext/ladspa/gstladspa.c
+++ b/ext/ladspa/gstladspa.c
@@ -302,7 +302,19 @@
return FALSE;
while ((entry_name = g_dir_read_name (dir))) {
+ /* Only attempt to open files with the module suffixes */
+ if (!g_str_has_suffix (entry_name, "." G_MODULE_SUFFIX)
+#ifdef GST_EXTRA_MODULE_SUFFIX
+ && !g_str_has_suffix (entry_name, GST_EXTRA_MODULE_SUFFIX)
+#endif
+ ) {
+ GST_TRACE ("Ignoring file %s as it has the wrong suffix for a plugin",
+ entry_name);
+ continue;
+ }
+
file_name = g_build_filename (dir_name, entry_name, NULL);
+ GST_LOG ("Probing file %s as a LADSPA plugin", file_name);
plugin =
g_module_open (file_name, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
if (plugin) {