Update of /cvsroot/fink/packages/dists/unstable/main/finkinfo/sound
In directory usw-pr-cvs1:/tmp/cvs-serv8744

Added Files:
        esound-0.2.28-1.info esound-0.2.28-1.patch 
Log Message:
New upstream version with iMacs/eMacs patch from Alexander Strange.

--- NEW FILE: esound-0.2.28-1.info ---
Package: esound
Version: 0.2.28
Revision: 1
Depends: %N-bin, audiofile
BuildDepends: audiofile (>= 0.2.3-3), fink (>= 0.9.9)
Replaces: %N (<< 0.2.23-2)
Source: mirror:gnome:2.0.0/sources/%n/%n-%v.tar.bz2
Source-MD5: 87a9e394971457232fcd66cf9d1b0990
Patch: %f.patch
NoSetLDFLAGS: true
ConfigureParams: --mandir=%p/share/man
InstallScript: make install DESTDIR=%d
SplitOff: <<
  Package: %N-shlibs
  Depends: %N-common, audiofile-shlibs
  Replaces: %N (<< 0.2.23-2)
  Files: lib/libesd.*.dylib
  DocFiles: AUTHORS COPYING* ChangeLog NEWS README TIPS TODO
<<
SplitOff2: <<
  Package: %N-bin
  Depends: %N-shlibs
  Replaces: %N (<< 0.2.27-1)
  Files: <<
    bin/esd bin/esdcat bin/esdctl bin/esdfilt bin/esdloop
    bin/esdmon bin/esdplay bin/esdrec bin/esdsample
    share/man/man1
  <<
  DocFiles: AUTHORS COPYING* ChangeLog NEWS README TIPS TODO
<<
SplitOff3: <<
  Package: %N-common
  Provides: %N-data
  Replaces: %N (<< 0.2.23-2), %N-data
  Conflicts: %N-data
  Files: etc/
  ConfFiles: %p/etc/esd.conf
  DocFiles: AUTHORS COPYING* ChangeLog NEWS README TIPS TODO
<<
DocFiles: AUTHORS COPYING* ChangeLog NEWS README TIPS TODO
Description: Enlightened Sound Daemon
DescDetail: <<
EsounD, the Enlightened Sound Daemon, is a server process that mixes
several audio streams for playback by a single audio device. For
example, if you're listening to music on a CD and you receive a
sound-related event from ICQ, the two applications won't have to
jockey for the use of your sound card.     
<<
DescPort: <<
This package uses a patch by Shawn Hsiao and Masanori Sekino to enable
playback and recording via the CoreAudio API. It uses some evil hacking
to keep the CoreAudio dependency out of the library - there were
symbol clashes between CarbonCore (one of CoreAudio's dependencies)
and several esd-using programs.

Also needs some help to link against the right copy of its own library.

Applied a iMacs/eMacs patch from Alexander Strange (>= 0.2.28).
<<
License: GPL/LGPL
Maintainer: Masanori Sekino <[EMAIL PROTECTED]>
Homepage: http://www.gnome.org/

--- NEW FILE: esound-0.2.28-1.patch ---
diff -Naur esound-0.2.28.old/Makefile.in esound-0.2.28.tmp/Makefile.in
--- esound-0.2.28.old/Makefile.in       Wed Jun 19 23:05:14 2002
+++ esound-0.2.28.tmp/Makefile.in       Sun Jul  7 20:18:44 2002
@@ -163,7 +163,7 @@
 
 LDADD = libesd.la $(AUDIOFILE_LIBS)
 
-esd_LDADD = $(WRAP_LIB) $(LDADD)
+esd_LDADD = $(WRAP_LIB) $(LDADD) $(SOUND_LIBS)
 
 m4datadir = $(datadir)/aclocal
 m4data_DATA = esd.m4
@@ -204,11 +204,12 @@
 
 @NEED_GETOPT_FALSE@esd_OBJECTS =  esd.$(OBJEXT) clients.$(OBJEXT) \
 @NEED_GETOPT_FALSE@filter.$(OBJEXT) mix.$(OBJEXT) players.$(OBJEXT) \
-@NEED_GETOPT_FALSE@proto.$(OBJEXT) samples.$(OBJEXT) util.$(OBJEXT)
+@NEED_GETOPT_FALSE@proto.$(OBJEXT) samples.$(OBJEXT) util.$(OBJEXT) \
+@NEED_GETOPT_FALSE@esd_audio.$(OBJEXT)
 @NEED_GETOPT_TRUE@esd_OBJECTS =  esd.$(OBJEXT) clients.$(OBJEXT) \
 @NEED_GETOPT_TRUE@filter.$(OBJEXT) mix.$(OBJEXT) players.$(OBJEXT) \
 @NEED_GETOPT_TRUE@proto.$(OBJEXT) samples.$(OBJEXT) getopt.$(OBJEXT) \
-@NEED_GETOPT_TRUE@getopt1.$(OBJEXT) util.$(OBJEXT)
+@NEED_GETOPT_TRUE@getopt1.$(OBJEXT) util.$(OBJEXT) esd_audio.$(OBJEXT)
 esd_DEPENDENCIES =  libesd.la
 esd_LDFLAGS = 
 esdcat_OBJECTS =  esdcat.$(OBJEXT)
diff -Naur esound-0.2.28.old/acconfig.h esound-0.2.28.tmp/acconfig.h
--- esound-0.2.28.old/acconfig.h        Tue Apr 23 18:33:07 2002
+++ esound-0.2.28.tmp/acconfig.h        Sun Jul  7 20:18:44 2002
@@ -9,6 +9,7 @@
 #undef DRIVER_NEWALSA
 #undef DRIVER_ALSA_09
 #undef DRIVER_DART
+#undef DRIVER_COREAUDIO
 #undef DRIVER_NONE
 #undef HAVE_INET_ATON
 #undef HAVE_NANOSLEEP
diff -Naur esound-0.2.28.old/audio.c esound-0.2.28.tmp/audio.c
--- esound-0.2.28.old/audio.c   Tue Jun  4 23:40:44 2002
+++ esound-0.2.28.tmp/audio.c   Sun Jul  7 20:18:44 2002
@@ -20,6 +20,8 @@
 /*******************************************************************/
 /* returns audio_fd for use by main prog - platform dependent */
 
+#if defined(INSIDE_ESD)
+
 /* ALSA before OSS as ALSA is OSS compatible */
 #if defined(DRIVER_ALSA) || defined(DRIVER_NEWALSA) 
 #  include "audio_alsa.c"
@@ -41,9 +43,16 @@
 #  include "audio_mklinux.c"
 #elif defined(DRIVER_DART)
 #  include "audio_dart.c"
+#elif defined(DRIVER_COREAUDIO)
+#  include "audio_coreaudio.c"
 #else
 #  include "audio_none.c"
 #endif
+
+#else
+#define DRIVER_NONE 1
+#include "audio_none.c"
+#endif /* INSIDE_ESD */
 
 /*******************************************************************/
 /* display available devices */
diff -Naur esound-0.2.28.old/audio_coreaudio.c esound-0.2.28.tmp/audio_coreaudio.c
--- esound-0.2.28.old/audio_coreaudio.c Thu Jan  1 09:00:00 1970
+++ esound-0.2.28.tmp/audio_coreaudio.c Sun Jul  7 20:18:44 2002
@@ -0,0 +1,451 @@
+
+/*
+ * for CoreAudio
+ *
+ * If the playback/recording sound device is not stereo and its sample
+ * size is not float (32 bit), this will not work.
+ *
+ * Please let me know if there is such a case.
+ *
+ * Shawn Hsiao <[EMAIL PROTECTED]>
+ * Some enhancement by Masanori Sekino <[EMAIL PROTECTED]>
+ */
+
+#include <CoreAudio/CoreAudio.h>
+#include <limits.h>
+#include <pthread.h>
+
+#define BUF_SIZE ESD_BUF_SIZE
+
+static AudioDeviceID gOutputDeviceID, gInputDeviceID;
+
+static float OutputDataBuf[BUF_SIZE];
+static float InputDataBuf[BUF_SIZE];
+static int OutputWroteSamples = 0;
+static int InputReadSamples = 0;
+
+static pthread_mutex_t mutexOutput, mutexInput;
+static pthread_cond_t condOutput, condInput;
+
+static int audioPlaybackStarted = 0, audioRecordStarted = 0;
+static int coreaudio_has_output_device = 0;
+static int coreaudio_has_input_device = 0;
+static int coreaudio_init = 0;
+
+OSStatus PlaybackIOProc(AudioDeviceID inDevice,
+                       const AudioTimeStamp *inNow,
+                       const AudioBufferList *inInputData,
+                       const AudioTimeStamp *inInputTime,
+                       AudioBufferList *outOutputData,
+                       const AudioTimeStamp *inOutputTime,
+                       void *inClientData)
+{
+  float *bufPtr = outOutputData->mBuffers[0].mData;
+  int i;
+
+  pthread_mutex_lock(&mutexOutput);
+
+  for (i = 0; i < OutputWroteSamples; i++)
+    bufPtr[i] = OutputDataBuf[i];
+  for ( ; i < BUF_SIZE; i++)
+    bufPtr[i] = 0;
+  OutputWroteSamples = 0;
+
+  pthread_mutex_unlock(&mutexOutput);
+  pthread_cond_signal(&condOutput);
+
+  return (kAudioHardwareNoError);
+}
+
+OSStatus RecordIOProc(AudioDeviceID inDevice,
+                     const AudioTimeStamp *inNow,
+                     const AudioBufferList *inInputData,
+                     const AudioTimeStamp *inInputTime,
+                     AudioBufferList *outOutputData,
+                     const AudioTimeStamp *inOutputTime,
+                     void *inClientData)
+{
+  float *bufPtr = inInputData->mBuffers[0].mData;
+  int i;
+
+  pthread_mutex_lock(&mutexInput);
+
+  for (i = 0; i < BUF_SIZE; i++)
+    InputDataBuf[i] = bufPtr[i];
+  InputReadSamples = 0;
+
+  pthread_mutex_unlock(&mutexInput);
+  pthread_cond_signal(&condInput);
+
+  return (kAudioHardwareNoError);
+}
+
+#define ARCH_esd_audio_devices
+const char *esd_audio_devices()
+{
+    return "coreaudio API only";
+}
+
+/*
+ * This is called to reset the device status.
+ * Returns -2 to indicate the device failed to initialize;
+ * returns  -1 means any of rate/size/{mono,stereo} mismatched.
+ */
+#define ARCH_esd_audio_open
+int esd_audio_open()
+{
+#define LEN_DEVICE_NAME 128
+  OSStatus status;
+  UInt32 propertySize, bufferByteCount;
+  char deviceName[LEN_DEVICE_NAME];
+  struct AudioStreamBasicDescription streamDesc;
+  int rval;
+
+  /*
+   * We only need to do this once, the rest are taken cared by
+   * disable/enable calback.
+   */
+  if (coreaudio_init) {
+    return (0);
+  }
+
+  /********************** playback section ***************************/
+  /* get default output device */
+  propertySize = sizeof(gOutputDeviceID);
+  status = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice,
+                                   &propertySize,
+                                   &gOutputDeviceID);
+  if (status) {
+    fprintf(stderr, "get default output device failed, status = %d\n",
+           (int)status);
+    return (-2);
+  }
+
+  if (gOutputDeviceID != kAudioDeviceUnknown) {
+    /* got default output device */
+    coreaudio_has_output_device = 1;
+
+    /* get output device name */
+    propertySize = sizeof(char)*LEN_DEVICE_NAME;
+    status = AudioDeviceGetProperty(gOutputDeviceID,
+                                   1,
+                                   0,
+                                   kAudioDevicePropertyDeviceName,
+                                   &propertySize,
+                                   deviceName);
+    if (status) {
+      fprintf(stderr, "get device name failed, status = %d\n",
+             (int)status);
+      return (-2);
+    }
+
+    /* get output format */
+    propertySize = sizeof(struct AudioStreamBasicDescription);
+    status = AudioDeviceGetProperty(gOutputDeviceID,
+                                   1,
+                                   0,
+                                   kAudioDevicePropertyStreamFormat,
+                                   &propertySize,
+                                   &streamDesc);
+    if (status) {
+      fprintf(stderr, "get device property failed, status = %d\n",
+             (int)status);
+      return (-2);
+    }
+
+    if ((streamDesc.mSampleRate != 44100.0) ||
+        (streamDesc.mFormatID != kAudioFormatLinearPCM) ||
+       !(streamDesc.mFormatFlags & kLinearPCMFormatFlagIsFloat) ||
+        (streamDesc.mChannelsPerFrame != 2))
+    {
+      fprintf (stderr, "unsupported device.\n");
+      return (-2);
+    }
+
+    /* set buffer size */
+    bufferByteCount = BUF_SIZE * sizeof(float);
+    propertySize = sizeof(bufferByteCount);
+    status = AudioDeviceSetProperty(gOutputDeviceID,
+                                    0,
+                                    0,
+                                    0,
+                                    kAudioDevicePropertyBufferSize,
+                                    propertySize,
+                                    &bufferByteCount);
+    if (status) {
+      fprintf(stderr, "set device property failed, status = %d\n",
+              (int)status);
+    }
+
+    fprintf(stderr, "using device %s for output:\n", deviceName);
+    fprintf(stderr, "\twith sample rate %f, %ld channels and %ld-bit sample\n",
+           streamDesc.mSampleRate,
+           streamDesc.mChannelsPerFrame,
+           streamDesc.mBitsPerChannel);
+
+    rval = pthread_mutex_init(&mutexOutput, NULL);
+    if (rval) {
+      fprintf(stderr, "mutex init failed\n");
+      return (-1);
+    }
+    rval = pthread_cond_init(&condOutput, NULL);
+    if (rval) {
+      fprintf(stderr, "condition init failed\n");
+      return (-1);
+    }
+
+    /* Registers PlaybackIOProc with the device without activating it. */
+    status = AudioDeviceAddIOProc(gOutputDeviceID, PlaybackIOProc, (void *)1);
+  }
+
+  /********************** record section ***************************/
+  /* get default input device */
+  propertySize = sizeof(gInputDeviceID);
+  status = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice,
+                                   &propertySize,
+                                   &gInputDeviceID);
+  if (status) {
+    fprintf(stderr, "get default input device failed, status = %d\n",
+           (int)status);
+    return (-2);
+  }
+
+  if (gInputDeviceID != kAudioDeviceUnknown) {
+    /* got default input device */
+    coreaudio_has_input_device = 1;
+
+    /* get input device name */
+    propertySize = sizeof(char)*64;
+    status = AudioDeviceGetProperty(gInputDeviceID,
+                                   1,
+                                   1,
+                                   kAudioDevicePropertyDeviceName,
+                                   &propertySize,
+                                   deviceName);
+    if (status) {
+      fprintf(stderr, "get device name failed, status = %d\n",
+             (int)status);
+      return (-2);
+    }
+
+    /* get input format */
+    propertySize = sizeof(struct AudioStreamBasicDescription);
+    status = AudioDeviceGetProperty(gInputDeviceID,
+                                   1,
+                                   1,
+                                   kAudioDevicePropertyStreamFormat,
+                                   &propertySize,
+                                   &streamDesc);
+    if (status) {
+      fprintf(stderr, "get device property failed, status = %d\n",
+             (int)status);
+      return (-2);
+    }
+
+    if ((streamDesc.mSampleRate != 44100.0) ||
+        (streamDesc.mFormatID != kAudioFormatLinearPCM) ||
+       !(streamDesc.mFormatFlags & kLinearPCMFormatFlagIsFloat) ||
+        (streamDesc.mChannelsPerFrame != 2))
+    {
+      fprintf (stderr, "unsupported device.\n");
+      return (-2);
+    }
+
+    /* set buffer size */
+    bufferByteCount = BUF_SIZE * sizeof(float);
+    propertySize = sizeof(bufferByteCount);
+    status = AudioDeviceSetProperty(gInputDeviceID,
+                                    0,
+                                    0,
+                                    1,
+                                    kAudioDevicePropertyBufferSize,
+                                    propertySize,
+                                    &bufferByteCount);
+    if (status) {
+      fprintf(stderr, "set device property failed, status = %d\n",
+              (int)status);
+    }
+
+    fprintf(stderr, "using device %s for input:\n", deviceName);
+    fprintf(stderr, "\twith sample rate %f, %ld channels and %ld-bit sample\n",
+           streamDesc.mSampleRate,
+           streamDesc.mChannelsPerFrame,
+           streamDesc.mBitsPerChannel);
+
+    rval = pthread_mutex_init(&mutexInput, NULL);
+    if (rval) {
+      fprintf(stderr, "mutex init failed\n");
+      return (-1);
+    }
+    rval = pthread_cond_init(&condInput, NULL);
+    if (rval) {
+      fprintf(stderr, "condition init failed\n");
+      return (-1);
+    }
+
+    /* Registers PlaybackIOProc with the device without activating it. */
+    status = AudioDeviceAddIOProc(gInputDeviceID, RecordIOProc, (void *)1);
+  }
+
+  if (!coreaudio_has_output_device) {
+    fprintf(stderr, "unknown output device.\n");
+    return (-2);
+  }
+  /* Allow lack of recording device */
+  /*
+  if (!coreaudio_has_input_device) {
+    fprintf(stderr, "unknown input device.\n");
+    return (-2);
+  }
+  */
+
+  /* Indicates the initialization is done */
+  coreaudio_init = 1;
+
+  esd_audio_fd = 0; /* this is meaningless anyway */
+
+  return 0;
+}
+
+/*
+ * This is called to reset the device status.
+ * (before calls esd_audio_open again)
+ */
+#define ARCH_esd_audio_close
+void esd_audio_close()
+{
+  OSStatus status;
+
+  /* deactivate both of them */
+  if (coreaudio_has_output_device && audioPlaybackStarted) {
+    status = AudioDeviceStop(gOutputDeviceID, PlaybackIOProc);
+    audioPlaybackStarted = 0;
+  }
+
+  if (coreaudio_has_input_device && audioRecordStarted) {
+    status = AudioDeviceStop(gInputDeviceID, RecordIOProc);
+    audioRecordStarted = 0;
+  }
+
+  return;
+}
+
+
+#define ARCH_esd_audio_pause
+void esd_audio_pause()
+{
+  OSStatus status;
+
+  if (coreaudio_has_output_device && audioPlaybackStarted) {
+    status = AudioDeviceStop(gOutputDeviceID, PlaybackIOProc);
+    audioPlaybackStarted = 0;
+  }
+
+  if (coreaudio_has_input_device && audioRecordStarted) {
+    status = AudioDeviceStop(gInputDeviceID, RecordIOProc);
+    audioRecordStarted = 0;
+  }
+
+  return;
+}
+
+
+#define ARCH_esd_audio_write
+/*******************************************************************/
+/* dump a buffer to the sound device */
+int esd_audio_write( void *buffer, int buf_size )
+{
+  OSStatus status;
+  float scale = 1.0 / SHRT_MAX;
+  int remain_to_write = buf_size;
+
+  if (!coreaudio_has_output_device)
+    return -1;
+
+  if (!audioPlaybackStarted) {
+    status = AudioDeviceStart(gOutputDeviceID, PlaybackIOProc);
+    audioPlaybackStarted = 1;
+  }
+
+  while (remain_to_write)
+  {
+    pthread_mutex_lock(&mutexOutput);
+
+    while(OutputWroteSamples == BUF_SIZE)
+      pthread_cond_wait(&condOutput, &mutexOutput);
+
+    {
+      short *src_data = (short *)buffer + (buf_size - remain_to_write) / 
+sizeof(short);
+      float *dst_data = OutputDataBuf + OutputWroteSamples;
+      int src_samples = remain_to_write / sizeof(short);
+      int dst_samples = BUF_SIZE - OutputWroteSamples;
+      int n = (dst_samples < src_samples) ? dst_samples : src_samples;
+      int i;
+
+      for (i = 0; i < n; i++)
+        dst_data[i] = scale * src_data[i];
+
+      OutputWroteSamples += n;
+      remain_to_write -= n * sizeof(short);
+    }
+
+    pthread_mutex_unlock(&mutexOutput);
+  }
+
+  return (buf_size);
+}
+
+#define ARCH_esd_audio_read
+/*******************************************************************/
+/* read a chunk from the sound device */
+int esd_audio_read( void *buffer, int buf_size )
+{
+  OSStatus status;
+  float scale = SHRT_MAX;
+  int remain_to_read = buf_size;
+
+  if (!coreaudio_has_input_device)
+    return -1;
+
+  if (!audioRecordStarted) {
+    status = AudioDeviceStart(gInputDeviceID, RecordIOProc);
+    audioRecordStarted = 1;
+  }
+
+  while (remain_to_read)
+  {
+    pthread_mutex_lock(&mutexInput);
+
+    while(InputReadSamples == BUF_SIZE)
+      pthread_cond_wait(&condInput, &mutexInput);
+
+    {
+      float *src_data = InputDataBuf + InputReadSamples;
+      short *dst_data = (short *)buffer + (buf_size - remain_to_read) / sizeof(short);
+      int src_samples = BUF_SIZE - InputReadSamples;
+      int dst_samples = remain_to_read / sizeof(short);
+      int n = (dst_samples < src_samples) ? dst_samples : src_samples;
+      int i;
+
+      for (i = 0; i < n; i++)
+        dst_data[i] = (short)(scale * src_data[i]);
+
+      InputReadSamples += n;
+      remain_to_read -= n * sizeof(short);
+    }
+
+    pthread_mutex_unlock(&mutexInput);
+  }
+
+  return (buf_size);
+}
+
+
+#define ARCH_esd_audio_flush
+/*******************************************************************/
+/* flush the audio buffer */
+void esd_audio_flush()
+{
+  /* nothing needed */
+  return;
+}
diff -Naur esound-0.2.28.old/config.h.in esound-0.2.28.tmp/config.h.in
--- esound-0.2.28.old/config.h.in       Tue Jun  4 23:41:36 2002
+++ esound-0.2.28.tmp/config.h.in       Sun Jul  7 20:18:44 2002
@@ -43,6 +43,7 @@
 #undef DRIVER_NEWALSA
 #undef DRIVER_ALSA_09
 #undef DRIVER_DART
+#undef DRIVER_COREAUDIO
 #undef DRIVER_NONE
 #undef HAVE_INET_ATON
 #undef HAVE_NANOSLEEP
diff -Naur esound-0.2.28.old/configure esound-0.2.28.tmp/configure
--- esound-0.2.28.old/configure Wed Jun 19 23:04:12 2002
+++ esound-0.2.28.tmp/configure Sun Jul  7 20:18:44 2002
@@ -6889,6 +6889,14 @@
 EOF
 
       ;;
+   darwin*)
+      found_sound=yes
+      cat >> confdefs.h <<\EOF
+#define DRIVER_COREAUDIO 1
+EOF
+
+      SOUND_LIBS="-framework CoreAudio"
+      ;;
    esac
 
    if test "${ac_cv_header_dmedia_audio_h}" = "yes"; then
diff -Naur esound-0.2.28.old/esd.c esound-0.2.28.tmp/esd.c
--- esound-0.2.28.old/esd.c     Mon Jun 17 18:33:23 2002
+++ esound-0.2.28.tmp/esd.c     Sun Jul  7 20:18:44 2002
@@ -21,6 +21,13 @@
 #define gethostbyname2(host, family) gethostbyname((host))
 #endif /* HAVE_GETHOSTBYNAME2 */
 
+#if defined (__APPLE__)
+#include <mach/mach.h>
+#include <mach/thread_policy.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#endif
+
 /*******************************************************************/
 /* esd.c - prototypes */
 void set_audio_buffer( void *buf, esd_format_t format, int magl, int magr,
@@ -514,6 +521,29 @@
 
     int default_format = ESD_BITS16 | ESD_STEREO;
     /* end test scaffolding parameters */
+
+#if defined (__APPLE__)
+    /* get realtime priority */
+    {
+       struct thread_time_constraint_policy ttcpolicy;
+       int bus_speed, mib [2] = { CTL_HW, HW_BUS_FREQ };
+       size_t len;   
+
+       len = sizeof (bus_speed);
+       sysctl (mib, 2, &bus_speed, &len, NULL, 0);
+
+       /* Is it enough? */
+       ttcpolicy.period = bus_speed / 120;
+       ttcpolicy.computation = bus_speed / 2400;
+       ttcpolicy.constraint = bus_speed / 1200;
+       ttcpolicy.preemptible = 1;
+
+       thread_policy_set (mach_thread_self (),
+                          THREAD_TIME_CONSTRAINT_POLICY,
+                          (int*)&ttcpolicy,
+                          THREAD_TIME_CONSTRAINT_POLICY_COUNT);
+    }
+#endif
 
     programname = *argv;
 
diff -Naur esound-0.2.28.old/esd.conf esound-0.2.28.tmp/esd.conf
--- esound-0.2.28.old/esd.conf  Tue Jun  4 23:30:47 2002
+++ esound-0.2.28.tmp/esd.conf  Sun Jul  7 20:18:44 2002
@@ -1,4 +1,4 @@
 [esd]
 auto_spawn=1
 spawn_options=-terminate -nobeeps -as 2
-spawn_wait_ms=100
+spawn_wait_ms=999
diff -Naur esound-0.2.28.old/esd_audio.c esound-0.2.28.tmp/esd_audio.c
--- esound-0.2.28.old/esd_audio.c       Thu Jan  1 09:00:00 1970
+++ esound-0.2.28.tmp/esd_audio.c       Sun Jul  7 20:18:44 2002
@@ -0,0 +1,4 @@
+/* dirty trickery to reduce shared library dependencies */
+
+#define INSIDE_ESD
+#include "audio.c"
diff -Naur esound-0.2.28.old/esd_config.c esound-0.2.28.tmp/esd_config.c
--- esound-0.2.28.old/esd_config.c      Wed Jun 19 21:14:24 2002
+++ esound-0.2.28.tmp/esd_config.c      Sun Jul  7 20:18:44 2002
@@ -16,7 +16,7 @@
 int esd_no_spawn=1; /* If we can't find even the system config file,
                       things are screwed up - don't try to make things
                       worse. */
-int esd_spawn_wait_ms=100; /* Time to wait trying to connect to an
+int esd_spawn_wait_ms=999; /* Time to wait trying to connect to an
                              autospawned ESD, in milliseconds. */
 char esd_spawn_options[LINEBUF_SIZE] = "-terminate -nobeeps -as 2";
 
diff -Naur esound-0.2.28.old/esdlib.c esound-0.2.28.tmp/esdlib.c
--- esound-0.2.28.old/esdlib.c  Wed Jun 19 22:45:14 2002
+++ esound-0.2.28.tmp/esdlib.c  Sun Jul  7 20:18:44 2002
@@ -681,8 +681,8 @@
        FD_ZERO (&fdset);
        FD_SET (esd_pipe[0], &fdset);
        
-       timeout.tv_sec = 0;
-       timeout.tv_usec = esd_spawn_wait_ms * 1000;
+       timeout.tv_sec = (esd_spawn_wait_ms * 1000) / 1000000;
+       timeout.tv_usec = (esd_spawn_wait_ms * 1000) % 1000000;
        
        ret = select (esd_pipe[0] + 1, &fdset, NULL, NULL, &timeout);
        



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Oh, it's good to be a geek.
http://thinkgeek.com/sf
_______________________________________________
Fink-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to