mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
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:
parent
61ed3b06ee
commit
47bd1b0545
1 changed files with 7 additions and 2 deletions
|
@ -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)) {
|
||||||
|
|
Loading…
Reference in a new issue