diff --git a/ChangeLog b/ChangeLog index 2a0686f492..16e9aba92d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-05-11 Michael Smith + + * gst/gstplugin.c: (gst_plugin_load_file): + * gst/gstregistry.c: (gst_registry_scan_path_level): + Don't print a g_warning for any failure to load a shared object. + Instead, push this down into gstplugin.c, and warn _only_ if we + failed to open the module (i.e. failure to link). + Avoids warnings on normal, working, non-plugin .so files. + 2007-05-11 Stefan Kost * gst/gstplugin.c (gst_plugin_load_file): diff --git a/gst/gstplugin.c b/gst/gstplugin.c index f75ea504a9..d537b03da4 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -415,6 +415,10 @@ gst_plugin_load_file (const gchar * filename, GError ** error) g_set_error (error, GST_PLUGIN_ERROR, GST_PLUGIN_ERROR_MODULE, "Opening module failed: %s", g_module_error ()); + /* If we failed to open the shared object, then it's probably because a + * plugin is linked against the wrong libraries. Print out an easy-to-see + * message in this case. */ + g_warning ("Failed to load plugin: %s", g_module_error ()); goto return_error; } diff --git a/gst/gstregistry.c b/gst/gstregistry.c index 7846799e3d..287e0c5e57 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -803,7 +803,6 @@ gst_registry_scan_path_level (GstRegistry * registry, const gchar * path, GstPlugin *plugin; GstPlugin *newplugin; gboolean changed = FALSE; - GError *err = NULL; dir = g_dir_open (path, 0, NULL); if (!dir) @@ -882,19 +881,15 @@ gst_registry_scan_path_level (GstRegistry * registry, const gchar * path, G_GINT64_FORMAT, plugin->file_mtime, file_status.st_mtime, (gint64) plugin->file_size, (gint64) file_status.st_size); gst_registry_remove_plugin (gst_registry_get_default (), plugin); - newplugin = gst_plugin_load_file (filename, &err); + /* We don't use a GError here because a failure to load some shared + * objects as plugins is normal (particularly in the uninstalled case) + */ + newplugin = gst_plugin_load_file (filename, NULL); if (newplugin) { GST_DEBUG_OBJECT (registry, "marking new plugin %p as registered", newplugin); newplugin->registered = TRUE; gst_object_unref (newplugin); - } else { - if (err) { - /* Report error to user, and free error */ - g_warning ("Failed to load plugin: %s", err->message); - g_error_free (err); - err = NULL; - } } changed = TRUE; } @@ -902,18 +897,11 @@ gst_registry_scan_path_level (GstRegistry * registry, const gchar * path, } else { GST_DEBUG_OBJECT (registry, "file %s not yet in registry", filename); - newplugin = gst_plugin_load_file (filename, &err); + newplugin = gst_plugin_load_file (filename, NULL); if (newplugin) { newplugin->registered = TRUE; gst_object_unref (newplugin); changed = TRUE; - } else { - if (err) { - /* Report error to user, and free error */ - g_warning ("Failed to load plugin: %s", err->message); - g_error_free (err); - err = NULL; - } } }