[xiph-cvs] cvs commit: ices/src im_sun.c

Karl Heyes karl at xiph.org
Wed Dec 24 07:52:09 PST 2003



karl        03/12/24 10:52:09

  Modified:    .        configure.in
               src      im_sun.c
  Log:
  build fix for sun input module, reported to work fine on openbsd however
  solaris needs verifying

Revision  Changes    Path
1.33      +2 -0      ices/configure.in

Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/ices/configure.in,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- configure.in	4 Aug 2003 08:38:33 -0000	1.32
+++ configure.in	24 Dec 2003 15:52:09 -0000	1.33
@@ -51,6 +51,7 @@
 
 dnl Checks for header files.
 AC_HEADER_STDC
+AC_CHECK_HEADERS([stropts.h])
 
 dnl Check for OSS
 
@@ -63,6 +64,7 @@
 
 dnl Check for Sun audio
 
+AC_C_BIGENDIAN
 AC_ARG_ENABLE(sun-audio,
     AC_HELP_STRING([--disable-sun-audio],
                    [Disable sun audio input (default autodetect)]),

<p><p>1.12      +15 -2     ices/src/im_sun.c

Index: im_sun.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/im_sun.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- im_sun.c	1 Jul 2003 23:53:06 -0000	1.11
+++ im_sun.c	24 Dec 2003 15:52:09 -0000	1.12
@@ -1,7 +1,7 @@
 /* im_sun.c
  * - Raw PCM input from Solaris audio devices
  *
- * $Id: im_sun.c,v 1.11 2003/07/01 23:53:06 karl Exp $
+ * $Id: im_sun.c,v 1.12 2003/12/24 15:52:09 karl Exp $
  *
  * by Ciaran Anscomb <ciarana at rd.bbc.co.uk>, based
  * on im_oss.c which is...
@@ -26,7 +26,9 @@
 #include <sys/audioio.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
+#ifdef HAVE_STROPTS_H
 #include <stropts.h>
+#endif
 #include <fcntl.h>
 
 #include "cfgparse.h"
@@ -162,7 +164,11 @@
     int use_metadata = 1; /* Default to on */
 
     mod->type = ICES_INPUT_PCM;
+#ifdef WORDS_BIGENDIAN
     mod->subtype = INPUT_PCM_BE_16;
+#else
+    mod->subtype = INPUT_PCM_LE_16;
+#endif
     mod->getdata = sun_read;
     mod->handle_event = event_handler;
     mod->metadata_update = metadata_update;
@@ -206,12 +212,19 @@
     s->device_info.record.precision = 16;
     s->device_info.record.encoding = AUDIO_ENCODING_LINEAR;
     s->device_info.record.port = AUDIO_LINE_IN;
+    s->device_info.record.pause = 0;
+
     if (ioctl(s->fd, AUDIO_SETINFO, &s->device_info) < 0) {
         LOG_ERROR2("Failed to configure audio device %s: %s",
                 device, strerror(errno));
         goto fail;
     }
-    ioctl(s->fd, I_FLUSH, FLUSHR);
+#ifdef __sun
+    ioctl (s->fd, I_FLUSH, FLUSHR);
+#endif
+#ifdef __OpenBSD__
+    ioctl (s->fd, AUDIO_FLUSH, NULL);
+#endif
 
     /* Check all went according to plan */
     if (s->device_info.record.sample_rate != sample_rate) {

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list