summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1785b80)
raw | patch | inline | side by side (parent: 1785b80)
author | Stefan Kost <ensonic@users.sourceforge.net> | |
Fri, 28 Apr 2006 20:47:23 +0000 (20:47 +0000) | ||
committer | Stefan Kost <ensonic@users.sourceforge.net> | |
Fri, 28 Apr 2006 20:47:23 +0000 (20:47 +0000) |
Original commit message from CVS:
* gst/gst.c:
* gst/gstregistry.c: (gst_registry_scan_path_level),
(gst_registry_scan_path):
* gst/gstregistry.h:
only write out registry if it has changed, fixes #338339
* gst/gst.c:
* gst/gstregistry.c: (gst_registry_scan_path_level),
(gst_registry_scan_path):
* gst/gstregistry.h:
only write out registry if it has changed, fixes #338339
ChangeLog | patch | blob | history | |
gst/gst.c | patch | blob | history | |
gst/gstregistry.c | patch | blob | history | |
gst/gstregistry.h | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index fb888c1b8469a1f36eba069575fa8589842a5d05..1bd46da2238b290ac373cc432062de4bc864db1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
* libs/gst/base/gstbasesink.c: (gst_base_sink_event):
* libs/gst/base/gstcollectpads.c: (gst_collect_pads_base_init),
(gst_collect_pads_is_collected), (gst_collect_pads_event):
- more detailed debug and formatting cleanup
+ more detailed debug and formatting cleanup,
+ forward newsegments to src-pad (so that e.g. adder not eats them)
2006-04-28 Stefan Kost <ensonic@users.sf.net>
diff --git a/gst/gst.c b/gst/gst.c
index 1661f5001c24f95947ad3a4b0268b0385d227cab..ee8fe3f5d57460519a89ac7200053e11dae2aee9 100644 (file)
--- a/gst/gst.c
+++ b/gst/gst.c
char *registry_file;
const char *plugin_path;
GstRegistry *default_registry;
+ gboolean changed = FALSE;
default_registry = gst_registry_get_default ();
registry_file = g_strdup (g_getenv ("GST_REGISTRY"));
GST_DEBUG ("GST_PLUGIN_PATH set to %s", plugin_path);
list = g_strsplit (plugin_path, G_SEARCHPATH_SEPARATOR_S, 0);
for (i = 0; list[i]; i++) {
- gst_registry_scan_path (default_registry, list[i]);
+ changed |= gst_registry_scan_path (default_registry, list[i]);
}
g_strfreev (list);
} else {
* system-installed ones */
home_plugins = g_build_filename (g_get_home_dir (),
".gstreamer-" GST_MAJORMINOR, "plugins", NULL);
- gst_registry_scan_path (default_registry, home_plugins);
+ changed |= gst_registry_scan_path (default_registry, home_plugins);
g_free (home_plugins);
/* add the main (installed) library path */
- gst_registry_scan_path (default_registry, PLUGINDIR);
+ changed |= gst_registry_scan_path (default_registry, PLUGINDIR);
} else {
char **list;
int i;
GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH set to %s", plugin_path);
list = g_strsplit (plugin_path, G_SEARCHPATH_SEPARATOR_S, 0);
for (i = 0; list[i]; i++) {
- gst_registry_scan_path (default_registry, list[i]);
+ changed |= gst_registry_scan_path (default_registry, list[i]);
}
g_strfreev (list);
}
- gst_registry_xml_write_cache (default_registry, registry_file);
+ if (changed) {
+ GST_DEBUG ("writing registry cache");
+ gst_registry_xml_write_cache (default_registry, registry_file);
+ }
_gst_registry_remove_cache_plugins (default_registry);
diff --git a/gst/gstregistry.c b/gst/gstregistry.c
index a0c02a195de803d4883142fd16d8393d6de53343..0d791c0a81ac8c14e04b91a5b20619785bf7f7ac 100644 (file)
--- a/gst/gstregistry.c
+++ b/gst/gstregistry.c
return plugin;
}
-static void
+static gboolean
gst_registry_scan_path_level (GstRegistry * registry, const gchar * path,
int level)
{
gchar *filename;
GstPlugin *plugin;
GstPlugin *newplugin;
+ gboolean changed = FALSE;
dir = g_dir_open (path, 0, NULL);
if (!dir)
- return;
+ return FALSE;
while ((dirent = g_dir_read_name (dir))) {
filename = g_strjoin ("/", path, dirent, NULL);
if (g_file_test (filename, G_FILE_TEST_IS_DIR)) {
if (level > 0) {
GST_LOG_OBJECT (registry, "found directory, recursing");
- gst_registry_scan_path_level (registry, filename, level - 1);
+ changed |= gst_registry_scan_path_level (registry, filename, level - 1);
} else {
GST_LOG_OBJECT (registry,
"found directory, but recursion level is too deep");
newplugin->registered = TRUE;
gst_object_unref (newplugin);
}
+ changed = TRUE;
}
gst_object_unref (plugin);
if (newplugin) {
newplugin->registered = TRUE;
gst_object_unref (newplugin);
+ changed = TRUE;
}
}
}
g_dir_close (dir);
+
+ GST_DEBUG_OBJECT (registry, "registry changed? %d", changed);
+
+ return changed;
}
/**
* Add the given path to the registry. The syntax of the
* path is specific to the registry. If the path has already been
* added, do nothing.
+ *
+ * Returns: %TRUE if registry changed
*/
-void
+gboolean
gst_registry_scan_path (GstRegistry * registry, const gchar * path)
{
- g_return_if_fail (GST_IS_REGISTRY (registry));
- g_return_if_fail (path != NULL);
+ gboolean changed;
+
+ g_return_val_if_fail (GST_IS_REGISTRY (registry), FALSE);
+ g_return_val_if_fail (path != NULL, FALSE);
GST_DEBUG_OBJECT (registry, "scanning path %s", path);
- gst_registry_scan_path_level (registry, path, 10);
+ changed = gst_registry_scan_path_level (registry, path, 10);
+
+ GST_DEBUG_OBJECT (registry, "registry changed? %d", changed);
+
+ return changed;
}
void
diff --git a/gst/gstregistry.h b/gst/gstregistry.h
index b24271e48f7982c5cfe604c3441730c54d56685c..9ac1f03d849dab87fbebfd54520404815ca58013 100644 (file)
--- a/gst/gstregistry.h
+++ b/gst/gstregistry.h
GstRegistry * gst_registry_get_default (void);
-void gst_registry_scan_path (GstRegistry *registry, const gchar *path);
+gboolean gst_registry_scan_path (GstRegistry *registry, const gchar *path);
GList* gst_registry_get_path_list (GstRegistry *registry);
gboolean gst_registry_add_plugin (GstRegistry *registry, GstPlugin *plugin);