registry: Avoid discovering plugins in hotdoc private directories
authorThibault Saunier <tsaunier@igalia.com>
Tue, 14 May 2019 17:44:43 +0000 (13:44 -0400)
committerThibault Saunier <tsaunier@gnome.org>
Thu, 16 May 2019 18:22:20 +0000 (18:22 +0000)
gst/gstregistry.c

index 32153ff..84d9d06 100644 (file)
@@ -1198,8 +1198,13 @@ gst_registry_scan_plugin_file (GstRegistryScanContext * context,
 }
 
 static gboolean
-is_blacklisted_hidden_directory (const gchar * dirent)
+is_blacklisted_directory (const gchar * dirent)
 {
+  /* hotdoc private folder can contain many files and it slows down
+   * the discovery for nothing */
+  if (g_str_has_prefix (dirent, "hotdoc-private-"))
+    return TRUE;
+
   if (G_LIKELY (dirent[0] != '.'))
     return FALSE;
 
@@ -1242,7 +1247,7 @@ gst_registry_scan_path_level (GstRegistryScanContext * context,
     }
 
     if (file_status.st_mode & S_IFDIR) {
-      if (G_UNLIKELY (is_blacklisted_hidden_directory (dirent))) {
+      if (G_UNLIKELY (is_blacklisted_directory (dirent))) {
         GST_TRACE_OBJECT (context->registry, "ignoring %s directory", dirent);
         g_free (filename);
         continue;