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.
This commit is contained in:
Erik Walthinsen 2000-12-04 09:32:43 +00:00
parent 61ed3b06ee
commit 47bd1b0545

View file

@ -28,7 +28,7 @@
#include "config.h" #include "config.h"
#undef PLUGINS_USE_SRCDIR //#undef PLUGINS_USE_SRCDIR
/* list of loaded modules and its sequence number */ /* list of loaded modules and its sequence number */
GList *_gst_modules; GList *_gst_modules;
@ -210,7 +210,7 @@ gboolean gst_plugin_load_absolute(gchar *name) {
GstPluginInitFunc initfunc; GstPluginInitFunc initfunc;
GstPlugin *plugin; GstPlugin *plugin;
GList *plugins; GList *plugins;
struct stat file_status;
if (g_module_supported() == FALSE) { if (g_module_supported() == FALSE) {
g_print("gstplugin: wow, you built this on a platform without dynamic loading???\n"); 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); //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); module = g_module_open(name,G_MODULE_BIND_LAZY);
if (module != NULL) { if (module != NULL) {
if (g_module_symbol(module,"plugin_init",(gpointer *)&initfunc)) { if (g_module_symbol(module,"plugin_init",(gpointer *)&initfunc)) {