summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2011-01-08 14:52:27 +0100
committerEdward Hervey <edward.hervey@collabora.co.uk>2011-01-10 11:38:19 +0100
commit8edee55a3a2241ef4d83df6ec405bc4ba6ba42f0 (patch)
treedd672b47b78e47fb95b4ff739038919104e04a47 /gst
parent27cd56b983f3826e22f3504bcdcb54ab061613ee (diff)
registry: Don't replace valid existing plugins by blacklisted ones
Only replace existing plugins by blacklisted ones if they correspond to the exact same plugin. If they're not the same, keep the existing valid one. Fixes #638941
Diffstat (limited to 'gst')
-rw-r--r--gst/gstregistry.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gst/gstregistry.c b/gst/gstregistry.c
index 27e41daf50..500d7ed901 100644
--- a/gst/gstregistry.c
+++ b/gst/gstregistry.c
@@ -424,8 +424,20 @@ gst_registry_add_plugin (GstRegistry * registry, GstPlugin * plugin)
gst_registry_lookup_bn_locked (registry, plugin->basename);
if (existing_plugin) {
GST_DEBUG_OBJECT (registry,
- "Replacing existing plugin %p with new plugin %p for filename \"%s\"",
- existing_plugin, plugin, GST_STR_NULL (plugin->filename));
+ "Replacing existing plugin \"%s\" %p with new plugin %p for filename \"%s\"",
+ GST_STR_NULL (existing_plugin->filename), existing_plugin, plugin,
+ GST_STR_NULL (plugin->filename));
+ /* If the new plugin is blacklisted and the existing one isn't cached, do not
+ * accept if it's from a different location than the existing one */
+ if ((plugin->flags & GST_PLUGIN_FLAG_BLACKLISTED) &&
+ strcmp (plugin->filename, existing_plugin->filename)) {
+ GST_WARNING_OBJECT (registry,
+ "Not replacing plugin because new one (%s) is blacklisted but for a different location than existing one (%s)",
+ plugin->filename, existing_plugin->filename);
+ gst_object_unref (plugin);
+ GST_OBJECT_UNLOCK (registry);
+ return FALSE;
+ }
registry->plugins = g_list_remove (registry->plugins, existing_plugin);
if (G_LIKELY (existing_plugin->basename))
g_hash_table_remove (registry->basename_hash,