diff options
author | Gene Z. Ragan <gzr@eazel.com> | 2001-04-05 18:11:05 +0000 |
---|---|---|
committer | Gene Ragan <gzr@src.gnome.org> | 2001-04-05 18:11:05 +0000 |
commit | 501a3c4764be074af430542879e0796d1c7c9ff3 (patch) | |
tree | 2a9b86c953010b9bb1f525e2cdc050a0a76db478 | |
parent | 58f18d162799245e531f720300c2654926b30d7e (diff) | |
download | nautilus-501a3c4764be074af430542879e0796d1c7c9ff3.tar.gz |
Fixed bug 7821, SOLARIS: Nautilus hangs attempted to initialize ESD
2001-04-05 Gene Z. Ragan <gzr@eazel.com>
Fixed bug 7821, SOLARIS: Nautilus hangs attempted to initialize ESD
* libnautilus-extensions/nautilus-global-preferences.h:
Remove unused sound init preference.
* libnautilus-extensions/nautilus-sound.c:
* libnautilus-extensions/nautilus-sound.h:
(nautilus_sound_initialize):
Remove call to esd_open_audio. It is the wrong call to use and
caused problems on Solaris.
(nautilus_sound_can_play_sound):
Call esd_sound_open to determine if we can handle audio playback.
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-global-preferences.h | 2 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-sound.c | 32 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-sound.h | 2 | ||||
-rw-r--r-- | libnautilus-private/nautilus-global-preferences.h | 2 | ||||
-rw-r--r-- | libnautilus-private/nautilus-sound.c | 32 | ||||
-rw-r--r-- | libnautilus-private/nautilus-sound.h | 2 |
7 files changed, 42 insertions, 46 deletions
@@ -1,4 +1,20 @@ 2001-04-05 Gene Z. Ragan <gzr@eazel.com> + + Fixed bug 7821, SOLARIS: Nautilus hangs attempted to initialize ESD + + * libnautilus-extensions/nautilus-global-preferences.h: + Remove unused sound init preference. + + * libnautilus-extensions/nautilus-sound.c: + * libnautilus-extensions/nautilus-sound.h: + (nautilus_sound_initialize): + Remove call to esd_open_audio. It is the wrong call to use and + caused problems on Solaris. + + (nautilus_sound_can_play_sound): + Call esd_sound_open to determine if we can handle audio playback. + +2001-04-05 Gene Z. Ragan <gzr@eazel.com> Fixed bug 7790, Music View silently fails if sound hardware busy or missing diff --git a/libnautilus-extensions/nautilus-global-preferences.h b/libnautilus-extensions/nautilus-global-preferences.h index 01faee062..87b959f20 100644 --- a/libnautilus-extensions/nautilus-global-preferences.h +++ b/libnautilus-extensions/nautilus-global-preferences.h @@ -39,8 +39,6 @@ BEGIN_GNOME_DECLS /* Keep track of the sound playing process */ #define NAUTILUS_PREFERENCES_CURRENT_SOUND_STATE "preferences/sound_state" -/* Does the system have audio output capability */ -#define NAUTILUS_PREFERENCES_HAS_AUDIO_OUT "preferences/audio_out" /* Text fields */ #define NAUTILUS_PREFERENCES_USE_EMACS_SHORTCUTS "preferences/use_emacs_shortcuts" diff --git a/libnautilus-extensions/nautilus-sound.c b/libnautilus-extensions/nautilus-sound.c index f859dbd1d..3015b9bfb 100644 --- a/libnautilus-extensions/nautilus-sound.c +++ b/libnautilus-extensions/nautilus-sound.c @@ -54,23 +54,8 @@ kill_sound_if_necessary (void) into a quiescent state */ void nautilus_sound_initialize (void) -{ - int open_result; - - nautilus_preferences_set_integer (NAUTILUS_PREFERENCES_CURRENT_SOUND_STATE, 0); - - /* Check and see if the system itself can play sound. We do this by attmepting - * to open esd. Save the result of this as a preference. This value only - * means that the system has audio out capabilities and should not be used as - * a way to check the current audio output state. - */ - open_result = esd_audio_open (); - if (open_result < 0) { - nautilus_preferences_set_integer (NAUTILUS_PREFERENCES_HAS_AUDIO_OUT, 0); - } else { - nautilus_preferences_set_integer (NAUTILUS_PREFERENCES_HAS_AUDIO_OUT, 1); - esd_audio_close (); - } +{ + nautilus_preferences_set_integer (NAUTILUS_PREFERENCES_CURRENT_SOUND_STATE, 0); } /* if there is a sound registered, kill it, and register the empty sound */ @@ -103,14 +88,21 @@ nautilus_sound_register_sound (pid_t sound_process) gboolean nautilus_sound_can_play_sound (void) { - int sound_process; + int sound_process, open_result; /* first see if there's already one in progress; if so, return true */ sound_process = nautilus_preferences_get_integer (NAUTILUS_PREFERENCES_CURRENT_SOUND_STATE); if (sound_process > 0) { return TRUE; } - + /* Now check and see if system has audio out capabilites */ - return nautilus_preferences_get_integer (NAUTILUS_PREFERENCES_HAS_AUDIO_OUT); + open_result = esd_open_sound (NULL); + if (open_result == -1) { + return FALSE; + } else { + esd_close (open_result); + return TRUE; + } } + diff --git a/libnautilus-extensions/nautilus-sound.h b/libnautilus-extensions/nautilus-sound.h index e58aa0744..3083c32a9 100644 --- a/libnautilus-extensions/nautilus-sound.h +++ b/libnautilus-extensions/nautilus-sound.h @@ -28,8 +28,8 @@ #include <glib.h> #include <sys/wait.h> -gboolean nautilus_sound_can_play_sound (void); void nautilus_sound_initialize (void); +gboolean nautilus_sound_can_play_sound (void); void nautilus_sound_kill_sound (void); void nautilus_sound_register_sound (pid_t sound_process); diff --git a/libnautilus-private/nautilus-global-preferences.h b/libnautilus-private/nautilus-global-preferences.h index 01faee062..87b959f20 100644 --- a/libnautilus-private/nautilus-global-preferences.h +++ b/libnautilus-private/nautilus-global-preferences.h @@ -39,8 +39,6 @@ BEGIN_GNOME_DECLS /* Keep track of the sound playing process */ #define NAUTILUS_PREFERENCES_CURRENT_SOUND_STATE "preferences/sound_state" -/* Does the system have audio output capability */ -#define NAUTILUS_PREFERENCES_HAS_AUDIO_OUT "preferences/audio_out" /* Text fields */ #define NAUTILUS_PREFERENCES_USE_EMACS_SHORTCUTS "preferences/use_emacs_shortcuts" diff --git a/libnautilus-private/nautilus-sound.c b/libnautilus-private/nautilus-sound.c index f859dbd1d..3015b9bfb 100644 --- a/libnautilus-private/nautilus-sound.c +++ b/libnautilus-private/nautilus-sound.c @@ -54,23 +54,8 @@ kill_sound_if_necessary (void) into a quiescent state */ void nautilus_sound_initialize (void) -{ - int open_result; - - nautilus_preferences_set_integer (NAUTILUS_PREFERENCES_CURRENT_SOUND_STATE, 0); - - /* Check and see if the system itself can play sound. We do this by attmepting - * to open esd. Save the result of this as a preference. This value only - * means that the system has audio out capabilities and should not be used as - * a way to check the current audio output state. - */ - open_result = esd_audio_open (); - if (open_result < 0) { - nautilus_preferences_set_integer (NAUTILUS_PREFERENCES_HAS_AUDIO_OUT, 0); - } else { - nautilus_preferences_set_integer (NAUTILUS_PREFERENCES_HAS_AUDIO_OUT, 1); - esd_audio_close (); - } +{ + nautilus_preferences_set_integer (NAUTILUS_PREFERENCES_CURRENT_SOUND_STATE, 0); } /* if there is a sound registered, kill it, and register the empty sound */ @@ -103,14 +88,21 @@ nautilus_sound_register_sound (pid_t sound_process) gboolean nautilus_sound_can_play_sound (void) { - int sound_process; + int sound_process, open_result; /* first see if there's already one in progress; if so, return true */ sound_process = nautilus_preferences_get_integer (NAUTILUS_PREFERENCES_CURRENT_SOUND_STATE); if (sound_process > 0) { return TRUE; } - + /* Now check and see if system has audio out capabilites */ - return nautilus_preferences_get_integer (NAUTILUS_PREFERENCES_HAS_AUDIO_OUT); + open_result = esd_open_sound (NULL); + if (open_result == -1) { + return FALSE; + } else { + esd_close (open_result); + return TRUE; + } } + diff --git a/libnautilus-private/nautilus-sound.h b/libnautilus-private/nautilus-sound.h index e58aa0744..3083c32a9 100644 --- a/libnautilus-private/nautilus-sound.h +++ b/libnautilus-private/nautilus-sound.h @@ -28,8 +28,8 @@ #include <glib.h> #include <sys/wait.h> -gboolean nautilus_sound_can_play_sound (void); void nautilus_sound_initialize (void); +gboolean nautilus_sound_can_play_sound (void); void nautilus_sound_kill_sound (void); void nautilus_sound_register_sound (pid_t sound_process); |