CVS Root: /cvs/gstreamer
Module: gstreamer
Changes by: slomo
Date: Mon Nov 24 2008 09:59:21 UTC
Log message:
Patch by: Simon Holm Thøgersen <odie at cs dot aau dot dk>
* gst/gstregistry.c: (gst_registry_scan_path_level):
Reduce the number of stat() calls for every file from three times
to one time. Fixes bug #560360.
Modified files:
. : ChangeLog
gst : gstregistry.c
Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.4173&r2=1.4174
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstregistry.c.diff?r1=1.84&r2=1.85
====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v
retrieving revision 1.4173
retrieving revision 1.4174
diff -u -d -r1.4173 -r1.4174
--- ChangeLog 22 Nov 2008 15:09:17 -0000 1.4173
+++ ChangeLog 24 Nov 2008 09:59:04 -0000 1.4174
@@ -1,3 +1,11 @@
+2008-11-24 Sebastian Dröge <[email protected]>
+
+ Patch by: Simon Holm Thøgersen <odie at cs dot aau dot dk>
+ * gst/gstregistry.c: (gst_registry_scan_path_level):
+ Reduce the number of stat() calls for every file from three times
+ to one time. Fixes bug #560360.
2008-11-22 Wim Taymans <[email protected]>
* libs/gst/base/gstbasetransform.c:
Index: gstregistry.c
RCS file: /cvs/gstreamer/gstreamer/gst/gstregistry.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- gstregistry.c 15 Jul 2008 22:53:00 -0000 1.84
+++ gstregistry.c 24 Nov 2008 09:59:07 -0000 1.85
@@ -100,6 +100,8 @@
#include <stdio.h>
#include <string.h>
+/* For g_stat () */
+#include <glib/gstdio.h>
#include "gstinfo.h"
#include "gstregistry.h"
@@ -808,9 +810,17 @@
return FALSE;
while ((dirent = g_dir_read_name (dir))) {
+ struct stat file_status;
filename = g_strjoin ("/", path, dirent, NULL);
+ if (g_stat (filename, &file_status) < 0) {
+ /* Plugin will be removed from cache after the scan completes if it
+ * is still marked 'cached' */
+ g_free (filename);
+ continue;
+ }
- if (g_file_test (filename, G_FILE_TEST_IS_DIR)) {
+ if (file_status.st_mode & S_IFDIR) {
/* skip the .debug directory, these contain elf files that are not
* useful or worse, can crash dlopen () */
if (g_str_equal (dirent, ".debug")) {
@@ -831,7 +841,7 @@
g_free (filename);
continue;
}
- if (!g_file_test (filename, G_FILE_TEST_IS_REGULAR)) {
+ if (!(file_status.st_mode & S_IFREG)) {
GST_LOG_OBJECT (registry, "%s is not a regular file, ignoring", filename);
@@ -853,15 +863,6 @@
* was already seen by the registry, we ignore it */
plugin = gst_registry_lookup (registry, filename);
if (plugin) {
- struct stat file_status;
-
- if (stat (filename, &file_status)) {
- /* Plugin will be removed from cache after the scan completes if it
- * is still marked 'cached' */
- g_free (filename);
- gst_object_unref (plugin);
- continue;
- }
if (plugin->registered) {
GST_DEBUG_OBJECT (registry,
"plugin already registered from path \"%s\"",
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-cvs-verbose mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs-verbose
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.