From 47bd1b0545d7f2c7693a39b1c131e19caa146148 Mon Sep 17 00:00:00 2001 From: Erik Walthinsen Date: Mon, 4 Dec 2000 09:32:43 +0000 Subject: [PATCH] Added a check to see if the plugin actually exists before even bothering to try to load it. Saves a fair amount of d... Original commit message from CVS: Added a check to see if the plugin actually exists before even bothering to try to load it. Saves a fair amount of debugging spew with _gst_plugin_spew enabled. --- gst/gstplugin.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gst/gstplugin.c b/gst/gstplugin.c index 406a9fb58d..4206a9b78d 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -28,7 +28,7 @@ #include "config.h" -#undef PLUGINS_USE_SRCDIR +//#undef PLUGINS_USE_SRCDIR /* list of loaded modules and its sequence number */ GList *_gst_modules; @@ -210,7 +210,7 @@ gboolean gst_plugin_load_absolute(gchar *name) { GstPluginInitFunc initfunc; GstPlugin *plugin; GList *plugins; - + struct stat file_status; if (g_module_supported() == FALSE) { g_print("gstplugin: wow, you built this on a platform without dynamic loading???\n"); @@ -230,6 +230,11 @@ gboolean gst_plugin_load_absolute(gchar *name) { } //g_print("trying to absolute load '%s\n",name); + if (stat(name,&file_status)) { +// g_print("problem opening file %s\n",name); + return FALSE; + } + module = g_module_open(name,G_MODULE_BIND_LAZY); if (module != NULL) { if (g_module_symbol(module,"plugin_init",(gpointer *)&initfunc)) {