diff options
author | Zaheer Abbas Merali <zaheerm@gentoo.org> | 2005-04-30 10:26:13 +0000 |
---|---|---|
committer | Zaheer Abbas Merali <zaheerm@gentoo.org> | 2005-04-30 10:26:13 +0000 |
commit | 87781c9e34346573596c3ded274e26b07f67dc16 (patch) | |
tree | 2eccbee9d788199175c1bcd2f9b07f944ad9b271 /media-libs/gstreamer/files | |
parent | Added to ~ppc (diff) | |
download | gentoo-2-87781c9e34346573596c3ded274e26b07f67dc16.tar.gz gentoo-2-87781c9e34346573596c3ded274e26b07f67dc16.tar.bz2 gentoo-2-87781c9e34346573596c3ded274e26b07f67dc16.zip |
mark ~ppc-macos with plugin loading fix just for os x
(Portage version: 2.0.51.19)
Diffstat (limited to 'media-libs/gstreamer/files')
-rw-r--r-- | media-libs/gstreamer/files/gstreamer-0.8.9-fixpluginload.patch | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/media-libs/gstreamer/files/gstreamer-0.8.9-fixpluginload.patch b/media-libs/gstreamer/files/gstreamer-0.8.9-fixpluginload.patch new file mode 100644 index 000000000000..e62488469b48 --- /dev/null +++ b/media-libs/gstreamer/files/gstreamer-0.8.9-fixpluginload.patch @@ -0,0 +1,134 @@ +--- gstreamer0.8-0.8.9/gst/gstplugin.c 2005-04-23 08:21:59.000000000 +1000 ++++ gstreamer0.8-0.8.9-patched/gst/gstplugin.c 2005-04-23 08:22:11.000000000 +1000 +@@ -302,6 +302,45 @@ + static void _gst_plugin_fault_handler_setup (); + + /** ++ * gst_plugin_check_module: ++ * @module: GModule handle to check for pluginness ++ * @error: pointer to a NULL-valued GError ++ * @pptr: pointer to a gpointer used to return the gst_plugin_desc symbol ++ * (can be NULL) ++ * ++ * Checks if the given module is a GStreamer plugin ++ * ++ * Returns: TRUE if the given module is a GStreamer plugin ++ */ ++static gboolean ++gst_plugin_check_module (GModule *module, const char *filename, GError **error, gpointer *pptr) ++{ ++ gpointer ptr; ++ ++ if (pptr == NULL) ++ pptr = &ptr; ++ ++ if (module == NULL) { ++ GST_DEBUG ("Error loading plugin %s, reason: %s", filename, ++ g_module_error ()); ++ g_set_error (error, GST_PLUGIN_ERROR, GST_PLUGIN_ERROR_MODULE, ++ "Error loading plugin %s, reason: %s", filename, g_module_error ()); ++ return FALSE; ++ } ++ ++ if (!g_module_symbol (module, "gst_plugin_desc", pptr)) { ++ GST_DEBUG ("Could not find plugin entry point in \"%s\"", filename); ++ g_set_error (error, ++ GST_PLUGIN_ERROR, ++ GST_PLUGIN_ERROR_MODULE, ++ "Could not find plugin entry point in \"%s\"", filename); ++ return FALSE; ++ } ++ ++ return TRUE; ++} ++ ++/** + * gst_plugin_check_file: + * @filename: the plugin filename to check for pluginness + * @error: pointer to a NULL-valued GError +@@ -315,7 +354,7 @@ + { + GModule *module; + struct stat file_status; +- gpointer ptr; ++ gboolean check; + + g_return_val_if_fail (filename != NULL, FALSE); + +@@ -335,28 +374,11 @@ + } + + module = g_module_open (filename, G_MODULE_BIND_LAZY); +- +- if (module == NULL) { +- GST_DEBUG ("Error loading plugin %s, reason: %s\n", filename, +- g_module_error ()); +- g_set_error (error, GST_PLUGIN_ERROR, GST_PLUGIN_ERROR_MODULE, +- "Error loading plugin %s, reason: %s\n", filename, g_module_error ()); +- return FALSE; +- } +- +- if (!g_module_symbol (module, "gst_plugin_desc", &ptr)) { +- GST_DEBUG ("Could not find plugin entry point in \"%s\"", filename); +- g_set_error (error, +- GST_PLUGIN_ERROR, +- GST_PLUGIN_ERROR_MODULE, +- "Could not find plugin entry point in \"%s\"", filename); +- g_module_close (module); +- return FALSE; +- } +- /* it's a plugin */ +- GST_INFO ("looks like a gst plugin \"%s\"", filename); ++ check = gst_plugin_check_module (module, filename, error, NULL); + g_module_close (module); +- return TRUE; ++ ++ GST_INFO ("file \"%s\" %s look like a gst plugin", filename, check ? "does" : "doesn't"); ++ return check; + } + + /** +@@ -382,16 +404,11 @@ + GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "attempt to load plugin \"%s\"", + filename); + +- if (!gst_plugin_check_file (filename, error)) +- return NULL; + + module = g_module_open (filename, G_MODULE_BIND_LAZY); + +- if (module == NULL) +- goto load_error; +- +- if (!g_module_symbol (module, "gst_plugin_desc", &ptr)) +- goto load_error; ++ if (!gst_plugin_check_module (module, filename, error, &ptr)) /* handles module == NULL case */ ++ return NULL; + + desc = (GstPluginDesc *) ptr; + +@@ -404,6 +421,7 @@ + } else { + free_plugin = FALSE; + if (gst_plugin_is_loaded (plugin)) { ++ g_module_close (module); + if (plugin->filename && strcmp (plugin->filename, filename) != 0) { + GST_WARNING + ("plugin %p from file \"%s\" with same name %s is already " +@@ -456,15 +474,11 @@ + GST_PLUGIN_ERROR, + GST_PLUGIN_ERROR_MODULE, + "gst_plugin_register_func failed for plugin \"%s\"", filename); ++ g_module_close (module); + if (free_plugin) + g_free (plugin); + return NULL; + } +-load_error: +- g_set_error (error, +- GST_PLUGIN_ERROR, +- GST_PLUGIN_ERROR_MODULE, "generic load error for \"%s\"", filename); +- return NULL; + } + + static void |