summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuergen Keil <jkeil@users.sourceforge.net>2001-09-24 18:15:59 +0000
committerJuergen Keil <jkeil@users.sourceforge.net>2001-09-24 18:15:59 +0000
commit131fc6c8fe138a4273cf7a7c389459d9d8f055cf (patch)
tree3814f8166a671e72fc19c0daa1f48e98ca9bc00e
parent29efc97b8b087ad7910eac97f4c6af4a4db1ba87 (diff)
downloadxine-lib-131fc6c8fe138a4273cf7a7c389459d9d8f055cf.tar.gz
xine-lib-131fc6c8fe138a4273cf7a7c389459d9d8f055cf.tar.bz2
Unblock SIGALRM, while we try to open esd. SIGALRM is used in an esd daemon
auto startup attempt to signal a daemon failure to the parent. CVS patchset: 691 CVS date: 2001/09/24 18:15:59
-rw-r--r--src/audio_out/audio_esd_out.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/audio_out/audio_esd_out.c b/src/audio_out/audio_esd_out.c
index 568293ddb..d5c0a1339 100644
--- a/src/audio_out/audio_esd_out.c
+++ b/src/audio_out/audio_esd_out.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_esd_out.c,v 1.10 2001/09/14 20:44:01 jcdutton Exp $
+ * $Id: audio_esd_out.c,v 1.11 2001/09/24 18:15:59 jkeil Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -30,6 +30,7 @@
#include <string.h>
#include <unistd.h>
#include <esd.h>
+#include <signal.h>
#include <sys/time.h>
#include <inttypes.h>
@@ -202,14 +203,31 @@ ao_driver_t *init_audio_out_plugin (config_values_t *config) {
esd_driver_t *this;
int audio_fd;
+ sigset_t vo_mask, vo_mask_orig;
/*
* open stream to ESD server
+ *
+ * esd_open_sound needs a working SIGALRM for detecting a failed
+ * attempt to autostart the esd daemon; esd notifies the process that
+ * attempts the esd daemon autostart with a SIGALRM (SIGUSR1) signal
+ * about a failure to open the audio device (successful daemin startup).
+ *
+ * Temporarily release the blocked SIGALRM, while esd_open_sound is active.
+ * (Otherwise xine hangs in esd_open_sound on a machine without sound)
*/
+ sigemptyset(&vo_mask);
+ sigaddset(&vo_mask, SIGALRM);
+ if (sigprocmask(SIG_UNBLOCK, &vo_mask, &vo_mask_orig))
+ printf("audio_esd_out: cannot unblock SIGALRM: %s\n", strerror(errno));
+
printf("audio_esd_out: connecting to esd server...\n");
audio_fd = esd_open_sound(NULL);
+ if (sigprocmask(SIG_SETMASK, &vo_mask_orig, NULL))
+ printf("audio_esd_out: cannot block SIGALRM: %s\n", strerror(errno));
+
if(audio_fd < 0) {
char *server = getenv("ESPEAKER");