From ff736c730d69d0180287356575a18aacd0dfd094 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Sun, 22 Jul 2018 09:52:23 +1000 Subject: [PATCH] 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 --- ext/ladspa/gstladspa.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ext/ladspa/gstladspa.c b/ext/ladspa/gstladspa.c index 87b7b605dd..e04e4bb12d 100644 --- a/ext/ladspa/gstladspa.c +++ b/ext/ladspa/gstladspa.c @@ -302,7 +302,19 @@ ladspa_plugin_directory_search (GstPlugin * ladspa_plugin, const char *dir_name) 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) {