esd patch for control center



Hi

One of the things GNOME is doing on log in is to execute a couple times
(one in gnome-session and one in gnome-settings-daemon) esound daemon.

Attached patch makes the settings daemon not execute it if already
running. Since I'm not really sure about it, could people test it and
confirm/deny its validity before I submit it to CVS and the release
team?
-- 
Rodrigo Moya <rodrigo gnome-db org>
? org.gnome.SettingsDaemon.desktop-service
? org.gnome.SettingsDaemon.service
? org.gnome.SettingsDaemon.service.in
? performance-patch.diff
Index: gnome-settings-sound.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/gnome-settings-daemon/gnome-settings-sound.c,v
retrieving revision 1.13
diff -u -p -r1.13 gnome-settings-sound.c
--- gnome-settings-sound.c	11 Jan 2006 10:17:21 -0000	1.13
+++ gnome-settings-sound.c	6 Feb 2006 17:37:21 -0000
@@ -55,22 +55,27 @@ start_esd (void) 
         char *tmpargv[3];
         char argbuf[32];
         time_t starttime;
-        GnomeClient *client = gnome_master_client ();
 
-	esdpid = gnome_execute_async (NULL, 2, (char **)esd_cmdline);
-	g_snprintf (argbuf, sizeof (argbuf), "%d", esdpid);
-	tmpargv[0] = "kill"; tmpargv[1] = argbuf; tmpargv[2] = NULL;
-	gnome_client_set_shutdown_command (client, 2, tmpargv);
-	starttime = time (NULL);
 	gnome_sound_init (NULL);
-
-	while (gnome_sound_connection_get () < 0
-	       && ((time(NULL) - starttime) < 4)) 
+	if (gnome_sound_connection_get () < 0)
 	{
+		GnomeClient *client = gnome_master_client ();
+
+		esdpid = gnome_execute_async (NULL, 2, (char **)esd_cmdline);
+		g_snprintf (argbuf, sizeof (argbuf), "%d", esdpid);
+		tmpargv[0] = "kill"; tmpargv[1] = argbuf; tmpargv[2] = NULL;
+		gnome_client_set_shutdown_command (client, 2, tmpargv);
+		starttime = time (NULL);
+		gnome_sound_init (NULL);
+
+		while (gnome_sound_connection_get () < 0
+		       && ((time(NULL) - starttime) < 4)) 
+		{
 #ifdef HAVE_USLEEP
-		usleep(1000);
+			usleep(1000);
 #endif
-		gnome_sound_init(NULL);
+			gnome_sound_init(NULL);
+		}
 	}
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]