Commit 34702d19 authored by Karl Heyes's avatar Karl Heyes
Browse files

build fix for sun input module, reported to work fine on openbsd however

solaris needs verifying

svn path=/trunk/ices/; revision=5715
parent 9f15ca20
...@@ -51,6 +51,7 @@ dnl Checks for libraries. ...@@ -51,6 +51,7 @@ dnl Checks for libraries.
dnl Checks for header files. dnl Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
AC_CHECK_HEADERS([stropts.h])
dnl Check for OSS dnl Check for OSS
...@@ -63,6 +64,7 @@ fi ...@@ -63,6 +64,7 @@ fi
dnl Check for Sun audio dnl Check for Sun audio
AC_C_BIGENDIAN
AC_ARG_ENABLE(sun-audio, AC_ARG_ENABLE(sun-audio,
AC_HELP_STRING([--disable-sun-audio], AC_HELP_STRING([--disable-sun-audio],
[Disable sun audio input (default autodetect)]), [Disable sun audio input (default autodetect)]),
......
/* im_sun.c /* im_sun.c
* - Raw PCM input from Solaris audio devices * - 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@rd.bbc.co.uk>, based * by Ciaran Anscomb <ciarana@rd.bbc.co.uk>, based
* on im_oss.c which is... * on im_oss.c which is...
...@@ -26,7 +26,9 @@ ...@@ -26,7 +26,9 @@
#include <sys/audioio.h> #include <sys/audioio.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_STROPTS_H
#include <stropts.h> #include <stropts.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#include "cfgparse.h" #include "cfgparse.h"
...@@ -162,7 +164,11 @@ input_module_t *sun_open_module(module_param_t *params) ...@@ -162,7 +164,11 @@ input_module_t *sun_open_module(module_param_t *params)
int use_metadata = 1; /* Default to on */ int use_metadata = 1; /* Default to on */
mod->type = ICES_INPUT_PCM; mod->type = ICES_INPUT_PCM;
#ifdef WORDS_BIGENDIAN
mod->subtype = INPUT_PCM_BE_16; mod->subtype = INPUT_PCM_BE_16;
#else
mod->subtype = INPUT_PCM_LE_16;
#endif
mod->getdata = sun_read; mod->getdata = sun_read;
mod->handle_event = event_handler; mod->handle_event = event_handler;
mod->metadata_update = metadata_update; mod->metadata_update = metadata_update;
...@@ -206,12 +212,19 @@ input_module_t *sun_open_module(module_param_t *params) ...@@ -206,12 +212,19 @@ input_module_t *sun_open_module(module_param_t *params)
s->device_info.record.precision = 16; s->device_info.record.precision = 16;
s->device_info.record.encoding = AUDIO_ENCODING_LINEAR; s->device_info.record.encoding = AUDIO_ENCODING_LINEAR;
s->device_info.record.port = AUDIO_LINE_IN; s->device_info.record.port = AUDIO_LINE_IN;
s->device_info.record.pause = 0;
if (ioctl(s->fd, AUDIO_SETINFO, &s->device_info) < 0) { if (ioctl(s->fd, AUDIO_SETINFO, &s->device_info) < 0) {
LOG_ERROR2("Failed to configure audio device %s: %s", LOG_ERROR2("Failed to configure audio device %s: %s",
device, strerror(errno)); device, strerror(errno));
goto fail; 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 */ /* Check all went according to plan */
if (s->device_info.record.sample_rate != sample_rate) { if (s->device_info.record.sample_rate != sample_rate) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment