From b4622dda5db6e25aa7979657e530188fc18c5ec6 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Mon, 6 Feb 2006 18:02:02 +0000 Subject: [PATCH] only start esd if not running. 2006-02-06 Rodrigo Moya * gnome-settings-sound.c (start_esd): only start esd if not running. --- gnome-settings-daemon/ChangeLog | 4 +++ gnome-settings-daemon/gnome-settings-sound.c | 27 ++++++++++++-------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/gnome-settings-daemon/ChangeLog b/gnome-settings-daemon/ChangeLog index 38e943d5d..d2a1570a6 100644 --- a/gnome-settings-daemon/ChangeLog +++ b/gnome-settings-daemon/ChangeLog @@ -1,3 +1,7 @@ +2006-02-06 Rodrigo Moya + + * gnome-settings-sound.c (start_esd): only start esd if not running. + 2006-01-30 Rodrigo Moya * gnome-settings-multimedia-keys.c: reverted commit from 2006-01-11. diff --git a/gnome-settings-daemon/gnome-settings-sound.c b/gnome-settings-daemon/gnome-settings-sound.c index b88eeab10..abc59d018 100644 --- a/gnome-settings-daemon/gnome-settings-sound.c +++ b/gnome-settings-daemon/gnome-settings-sound.c @@ -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); + } } }