The following diff adds a sndio backend to the Xine-lib library
which is used by Kaffeine / Xine(-ui), Gwenview (via Kaffeine)
and some parts of KDE via kdemultimedia.

I must note that while working on the sndio backend I found that
once implemented that even without using the aucat sound server,
Xine(-lib) based apps gracefully would deal with the lack of an
audio device if it was already open by another app. Where as with
the existing Sun audio backend the other apps would just outright
not play the content at all if the backend failed to open the
device, which I found really annoying. aucat is just icing on the
cake :)

Please test as much as possible. Nothing special needs to be done
other than building and upgrading the xine-lib package. The new
sndio backend has the highest priority so it'll be used automatically
over the Sun backend unless specifically overridden in the application
settings.


Index: Makefile
===================================================================
RCS file: /cvs/ports/multimedia/xine-lib/Makefile,v
retrieving revision 1.42
diff -u -p -r1.42 Makefile
--- Makefile    25 Sep 2008 20:43:09 -0000      1.42
+++ Makefile    11 Dec 2008 05:21:40 -0000
@@ -9,7 +9,7 @@ COMMENT-jack=           jackd audio output module
 
 V=                     1.1.15
 DISTNAME=              xine-lib-${V}
-PKGNAME-main=          ${DISTNAME}p4
+PKGNAME-main=          ${DISTNAME}p5
 PKGNAME-esd=           xine-lib-esd-${V}
 PKGNAME-arts=          xine-lib-arts-${V}
 PKGNAME-jack=          xine-lib-jack-${V}
@@ -32,7 +32,7 @@ MULTI_PACKAGES=               -main -esd -arts -jack
 
 WANTLIB=               expat fontconfig freetype m z
 WANTLIB-main=          ${WANTLIB} X11 Xau Xdmcp Xext Xinerama Xrandr \
-                       Xrender Xv c jpeg lcms pthread usbhid
+                       Xrender Xv c jpeg lcms pthread sndio usbhid
 WANTLIB-esd=           ${WANTLIB}
 WANTLIB-arts=          ${WANTLIB} pcre stdc++ glib-2.0 \
                        gmodule-2.0 gthread-2.0
@@ -87,7 +87,8 @@ MAKE_FLAGS+=          TOMSMOCOMP_LINKS=
 MAKE_FLAGS+=           TOMSMOCOMP_LINKS=\#
 .endif
 
-CONFIGURE_STYLE=       gnu
+CONFIGURE_STYLE=       autoconf
+AUTOCONF_VERSION=      2.61
 CONFIGURE_ARGS+=       --disable-optimizations \
                        --disable-mlib \
                        --disable-opengl \
@@ -134,6 +135,7 @@ CONFIGURE_ENV=              CPPFLAGS="-I${LOCALBASE}
                        ac_cv_member_audio_info_t_output_muted=yes
 
 post-extract:
+       @cp ${FILESDIR}/audio_sndio_out.c ${WRKSRC}/src/audio_out
 .if ${MACHINE_ARCH} == "i386"
        @cp ${FILESDIR}/i386_set_ldt.c ${WRKSRC}/src/libw32dll/wine
 .endif
Index: files/audio_sndio_out.c
===================================================================
RCS file: files/audio_sndio_out.c
diff -N files/audio_sndio_out.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ files/audio_sndio_out.c     11 Dec 2008 03:54:26 -0000
@@ -0,0 +1,415 @@
+/* -*- Mode: C; c-basic-offset: 2; indent-tabs-mode: nil -*- */
+
+/*
+ * Copyright (C) 2008 the xine project
+ *
+ * This file is part of xine, a free video player.
+ *
+ * xine is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * xine is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * ao plugin for sndio by Brad Smith <[EMAIL PROTECTED]>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <math.h>
+#include <unistd.h>
+#include <inttypes.h>
+#include <pthread.h>
+
+#include <sndio.h>
+
+#include "xine_internal.h"
+#include "xineutils.h"
+#include "audio_out.h"
+#include "bswap.h"
+
+#define GAP_TOLERANCE        AO_MAX_GAP
+
+typedef struct {
+  audio_driver_class_t  driver_class;
+  config_values_t       *config;
+  xine_t                *xine;
+} sndio_class_t;
+
+typedef struct sndio_driver_s {
+  ao_driver_t    ao_driver;
+  xine_t         *xine;
+
+  struct sio_hdl *hdl;
+  int            capabilities;
+  int            mode;
+
+  int            num_channels;
+  u_int32_t      sample_rate;
+  u_int32_t      bits_per_sample;
+  u_int32_t      bytes_per_frame;
+
+  struct {
+    int          volume;
+    int          mute;
+  } mixer;
+} sndio_driver_t;
+
+/*
+ * open the audio device for writing to
+ */
+static int ao_sndio_open(ao_driver_t *this_gen,
+                         uint32_t bits, uint32_t rate, int mode)
+{
+  sndio_driver_t *this = (sndio_driver_t *) this_gen;
+  struct sio_par par;
+
+  xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+           "audio_sndio_out: ao_sndio_open bits=%d rate=%d, mode=%d\n",
+           bits, rate, mode);
+
+  if (!(mode & this->capabilities)) {
+    xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+             "audio_sndio_out: ao_sndio_open unsupported mode %08x\n",
+             mode);
+    return 0;
+  }
+
+  this->hdl = sio_open(NULL, SIO_PLAY, 0);
+  if (this->hdl == NULL)
+    return 0;
+
+  sio_initpar(&par);
+
+  switch (mode) {
+  case AO_CAP_MODE_MONO:
+    par.pchan = 1;
+    break;
+  case AO_CAP_MODE_STEREO:
+    par.pchan = 2;
+    break;
+  case AO_CAP_MODE_4CHANNEL:
+    par.pchan = 4;
+    break;
+  case AO_CAP_MODE_4_1CHANNEL:
+  case AO_CAP_MODE_5CHANNEL:
+  case AO_CAP_MODE_5_1CHANNEL:
+    par.pchan = 6;
+    break;
+  default:
+    xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+             "audio_sndio_out: ao_sndio_open does not support the requested 
mode: 0x%X\n",
+            mode);
+    return 0;
+  }
+
+  switch (bits) {
+  case 8:
+    par.bits = 8;
+    par.sig = 0;
+    par.le = 1;
+    break;
+  case 16:
+    par.bits = 16;
+    par.sig = 1;
+    par.le = 1;
+    break;
+  case 24:
+    par.bits = 24;
+    par.sig = 1;
+    par.le = 1;
+    break;
+  case 32:
+    par.bits = 32;
+    par.sig = 1;
+    par.le = 1;
+    break;
+  default:
+    xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+             "audio_sndio_out: ao_sndio_open bits per sample not supported: 
%d\n", bits);
+    return 0;
+  }
+
+  par.rate = rate;
+  par.bufsz = par.rate * 250 / 1000; /* 250ms buffer */
+
+  if (!sio_setpar(this->hdl, &par)) {
+    xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+             "audio_sndio_out: ao_sndio_open could not set params\n");
+    return 0;
+  }
+  if (!sio_getpar(this->hdl, &par)) {
+    xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+             "audio_sndio_out: ao_sndio_open could not get params\n");
+    return 0;
+  }
+
+  xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+           "audio_esd_out: ao_sndio_open %d channels output\n",
+           par.pchan);
+
+  if (!sio_start(this->hdl)) {
+    xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+             "audio_sndio_out: ao_sndio_open could not start\n");
+    return 0;
+  }
+
+  this->mode                   = mode;
+  this->sample_rate            = par.rate;
+  this->bits_per_sample        = par.bits;
+  this->num_channels           = par.pchan;
+  this->bytes_per_frame        = (this->bits_per_sample * this->num_channels) 
/ 8;
+
+  return this->sample_rate;
+}
+
+
+static int ao_sndio_num_channels(ao_driver_t *this_gen)
+{
+  sndio_driver_t *this = (sndio_driver_t *) this_gen;
+
+  return this->num_channels;
+}
+
+static int ao_sndio_bytes_per_frame(ao_driver_t *this_gen)
+{
+  sndio_driver_t *this = (sndio_driver_t *) this_gen;
+
+  return this->bytes_per_frame;
+}
+
+static int ao_sndio_get_gap_tolerance (ao_driver_t *this_gen)
+{
+  return GAP_TOLERANCE;
+}
+
+static int ao_sndio_write(ao_driver_t *this_gen, int16_t *data,
+                         uint32_t num_frames)
+{
+  sndio_driver_t *this = (sndio_driver_t *) this_gen;
+  size_t size = num_frames * this->bytes_per_frame;
+  int ret = 0;
+
+  ret = sio_write(this->hdl, data, size);
+
+  return ret;
+
+}
+
+static int ao_sndio_delay (ao_driver_t *this_gen)
+{
+  sndio_driver_t *this = (sndio_driver_t *) this_gen;
+  int ret = 0;
+
+  return ret;
+}
+
+static void ao_sndio_close(ao_driver_t *this_gen)
+{
+  sndio_driver_t *this = (sndio_driver_t *) this_gen;
+
+  if (!sio_stop(this->hdl)) {
+    xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+             "audio_sndio_out: ao_sndio_close could not stop\n");
+
+  }
+}
+
+static uint32_t ao_sndio_get_capabilities (ao_driver_t *this_gen)
+{
+  sndio_driver_t *this = (sndio_driver_t *) this_gen;
+
+  return this->capabilities;
+}
+
+static void ao_sndio_exit(ao_driver_t *this_gen)
+{
+  sndio_driver_t *this = (sndio_driver_t *) this_gen;
+
+  if (this->hdl)
+    sio_close(this->hdl);
+}
+
+static int ao_sndio_get_property (ao_driver_t *this_gen, int property)
+{
+  sndio_driver_t *this = (sndio_driver_t *) this_gen;
+
+  switch (property) {
+  case AO_PROP_PCM_VOL:
+  case AO_PROP_MIXER_VOL:
+    return this->mixer.volume;
+    break;
+  case AO_PROP_MUTE_VOL:
+    return this->mixer.mute;
+    break;
+  }
+
+  return 0;
+}
+
+static int ao_sndio_set_property (ao_driver_t *this_gen, int property, int 
value)
+{
+  sndio_driver_t *this = (sndio_driver_t *) this_gen;
+  int vol;
+
+  switch(property) {
+  case AO_PROP_PCM_VOL:
+  case AO_PROP_MIXER_VOL:
+    this->mixer.volume = value;
+    if (!this->mixer.mute)
+      sio_setvol(this->hdl, this->mixer.volume);
+    return this->mixer.volume;
+    break;
+
+  case AO_PROP_MUTE_VOL:
+    this->mixer.mute = (value) ? 1 : 0;
+    vol = 0;
+    if (!this->mixer.mute)
+      vol = this->mixer.volume;
+    sio_setvol(this->hdl, vol);
+    return value;
+    break;
+  }
+
+  return ~value;
+}
+
+static int ao_sndio_ctrl(ao_driver_t *this_gen, int cmd, ...)
+{
+  sndio_driver_t *this = (sndio_driver_t *) this_gen;
+  int ret = 0;
+
+  switch (cmd) {
+  case AO_CTRL_FLUSH_BUFFERS:
+    break;
+
+  case AO_CTRL_PLAY_RESUME:
+    if (!sio_start(this->hdl)) {
+      xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+               "audio_sndio_out: ao_sndio_ctrl could not start\n");
+      ret = 1;
+    }
+    break;
+
+  case AO_CTRL_PLAY_PAUSE:
+    if (!sio_stop(this->hdl)) {
+      xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+               "audio_sndio_out: ao_sndio_ctrl could not stop\n");
+      ret = 1;
+    }
+    break;
+  }
+
+  return ret;
+}
+
+static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void 
*data)
+{
+  sndio_class_t   *class = (sndio_class_t *) class_gen;
+  config_values_t *config = class->xine->config;
+  sndio_driver_t  *this;
+
+  lprintf ("audio_sndio_out: open_plugin called\n");
+
+  this = calloc(1, sizeof (sndio_driver_t));
+  if (!this)
+    return NULL;
+
+  this->xine = class->xine;
+
+  /*
+   * set capabilities
+   */
+  this->capabilities =
+    AO_CAP_MODE_MONO | AO_CAP_MODE_STEREO | AO_CAP_MODE_4CHANNEL |
+    AO_CAP_MODE_4_1CHANNEL | AO_CAP_MODE_5CHANNEL | AO_CAP_MODE_5_1CHANNEL |
+    AO_CAP_MIXER_VOL | AO_CAP_PCM_VOL | AO_CAP_MUTE_VOL |
+    AO_CAP_8BITS | AO_CAP_16BITS | AO_CAP_24BITS | AO_CAP_FLOAT32;
+
+  this->ao_driver.get_capabilities  = ao_sndio_get_capabilities;
+  this->ao_driver.get_property      = ao_sndio_get_property;
+  this->ao_driver.set_property      = ao_sndio_set_property;
+  this->ao_driver.open              = ao_sndio_open;
+  this->ao_driver.num_channels      = ao_sndio_num_channels;
+  this->ao_driver.bytes_per_frame   = ao_sndio_bytes_per_frame;
+  this->ao_driver.delay             = ao_sndio_delay;
+  this->ao_driver.write             = ao_sndio_write;
+  this->ao_driver.close             = ao_sndio_close;
+  this->ao_driver.exit              = ao_sndio_exit;
+  this->ao_driver.get_gap_tolerance = ao_sndio_get_gap_tolerance;
+  this->ao_driver.control           = ao_sndio_ctrl;
+
+  return &this->ao_driver;
+}
+
+/*
+ * class functions
+ */
+
+static char* get_identifier (audio_driver_class_t *this_gen)
+{
+  return "sndio";
+}
+
+static char* get_description (audio_driver_class_t *this_gen)
+{
+  return _("xine audio output plugin using sndio audio devices/drivers ");
+}
+
+static void dispose_class (audio_driver_class_t *this_gen)
+{
+  sndio_class_t *this = (sndio_class_t *) this_gen;
+
+  free(this);
+}
+
+static void *init_class (xine_t *xine, void *data)
+{
+  sndio_class_t        *this;
+
+  lprintf ("audio_sndio_out: init class\n");
+
+  this = calloc(1, sizeof (sndio_class_t));
+  if (!this)
+    return NULL;
+
+  this->driver_class.open_plugin     = open_plugin;
+  this->driver_class.get_identifier  = get_identifier;
+  this->driver_class.get_description = get_description;
+  this->driver_class.dispose         = dispose_class;
+
+  this->config = xine->config;
+  this->xine = xine;
+
+  return this;
+}
+
+static const ao_info_t ao_info_sndio = {
+  12
+};
+
+/*
+ * exported plugin catalog entry
+ */
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+  /* type, API, "name", version, special_info, init_function */
+  { PLUGIN_AUDIO_OUT, 8, "sndio", XINE_VERSION_CODE, &ao_info_sndio, 
init_class },
+  { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
Index: patches/patch-configure
===================================================================
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- patches/patch-configure     15 Sep 2008 22:11:42 -0000      1.19
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,101 +0,0 @@
-$OpenBSD: patch-configure,v 1.19 2008/09/15 22:11:42 jakemsr Exp $
---- configure.orig     Thu Aug 14 17:18:56 2008
-+++ configure  Thu Aug 14 19:04:37 2008
-@@ -24654,6 +24654,9 @@ _ACEOF
- fi
- done
- 
-+LIBICONV=$LTLIBICONV
-+LIBINTL=$LTLIBINTL
-+INTLLIBS=$LTLIBINTL
- 
- 
- { echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
-@@ -31009,13 +31012,13 @@ t q
- b
- :q
- q"
--x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libX11.so"* 
"${x_libraries:-/usr/lib}/libX11.so"* 2>/dev/null | sed -e 
\"${soname_script}\"`"
-+x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libX11.so"* 
"${x_libraries:-/usr/lib}/libX11.so"* 2>/dev/null | sed 1q`"
- 
- cat >>confdefs.h <<_ACEOF
- #define LIBX11_SO "${x_lib_location:-libX11.so}"
- _ACEOF
- 
--x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libXv.so"*  
"${x_libraries:-/usr/lib}/libXv.so"*  2>/dev/null | sed -e 
\"${soname_script}\"`"
-+x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libXv.so"*  
"${x_libraries:-/usr/lib}/libXv.so"*  2>/dev/null | sed 1q`"
- 
- cat >>confdefs.h <<_ACEOF
- #define LIBXV_SO "${x_lib_location:-libXv.so}"
-@@ -37851,7 +37854,7 @@ fi
-     LIBFLAC_LIBS="-L$prefix/$XINE_LIBNAME"
-   fi
- 
--  LIBFLAC_LIBS="$LIBFLAC_LIBS -lFLAC -lm"
-+  LIBFLAC_LIBS="$LIBFLAC_LIBS -lFLAC -logg -lm"
- 
-   if test "x$libFLAC_includes" != "x" ; then
-     LIBFLAC_CFLAGS="-I$libFLAC_includes"
-@@ -38100,7 +38103,7 @@ elif test "x$external_a52dec" = "xyes"; then
-   have_a52="yes"
- 
- 
--for ac_header in a52dec/a52.h a52dec/a52_internal.h
-+for ac_header in a52dec/a52.h
- do
- as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-@@ -38239,7 +38242,7 @@ if test $ac_cv_lib_a52_a52_init = yes; then
- #define HAVE_LIBA52 1
- _ACEOF
- 
--  LIBS="-la52 $LIBS"
-+  LIBS="-la52 -lm $LIBS"
- 
- else
-   have_a52="no"
-@@ -38805,7 +38808,7 @@ if test "${ac_cv_lib_mng_mng_initialize+set}" = set; t
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   ac_check_lib_save_LIBS=$LIBS
--LIBS="-lmng  $LIBS"
-+LIBS="-lmng -llcms -ljpeg -lz -lm $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
-@@ -38988,7 +38991,7 @@ echo "${ECHO_T}$ac_cv_header_libmng_h" >&6; }
- fi
- if test $ac_cv_header_libmng_h = yes; then
-    have_libmng=yes
--                MNG_LIBS="-lmng"
-+                MNG_LIBS="-lmng -llcms -ljpeg -lz -lm"
- else
-   { echo "$as_me:$LINENO: result: *** All libmng dependent parts will be 
disabled ***" >&5
- echo "${ECHO_T}*** All libmng dependent parts will be disabled ***" >&6; }
-@@ -50533,7 +50536,7 @@ cat >>confdefs.h <<_ACEOF
- _ACEOF
- 
-         CFLAGS="$CFLAGS -faltivec -maltivec"
--        LIBMPEG2_CFLAGS="$LIBMPEG2_CFLAGS -force_cpusubtype_ALL -faltivec 
-maltivec"
-+        LIBMPEG2_CFLAGS="$LIBMPEG2_CFLAGS -faltivec -maltivec"
-     fi
-     ;;
-   ppc-*-linux* | powerpc-*)
-@@ -51046,7 +51049,7 @@ XINE_SCRIPTPATH="\${xinedatadir}/scripts"
- 
- XINE_BUILD_CC="`$CC -v 2>&1 | tail -1 2>/dev/null`"
- XINE_BUILD_OS="`uname -s -r -m`"
--XINE_BUILD_DATE="`date \"+%a %d %b %Y %T\"`"
-+XINE_BUILD_DATE="`date "+%a %d %b %Y %T"`"
- 
- 
- 
-@@ -51927,7 +51930,7 @@ rm -f core conftest.err conftest.$ac_objext conftest_i
-     { echo "$as_me:$LINENO: result: $ac_cv_try_ldflags_ok" >&5
- echo "${ECHO_T}$ac_cv_try_ldflags_ok" >&6; }
-     if test x"$ac_cv_try_ldflags_ok" = x"yes"; then
--        NOUNDEF="-Wl,-z,defs"
-+        : # NOUNDEF="-Wl,-z,defs"
-     else
-         :
-     fi
Index: patches/patch-configure_ac
===================================================================
RCS file: patches/patch-configure_ac
diff -N patches/patch-configure_ac
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-configure_ac  11 Dec 2008 05:05:58 -0000
@@ -0,0 +1,105 @@
+$OpenBSD$
+--- configure.ac.orig  Wed Aug 13 12:26:38 2008
++++ configure.ac       Wed Dec 10 23:54:45 2008
+@@ -206,6 +206,10 @@ AC_PROG_GMSGFMT_PLURAL
+ 
+ AC_CHECK_FUNCS([nl_langinfo])
+ 
++LIBICONV=$LTLIBICONV
++LIBINTL=$LTLIBINTL
++INTLLIBS=$LTLIBINTL
++
+ dnl ---------------------------------------------
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ dnl ---------------------------------------------
+@@ -537,9 +541,9 @@ t q
+ b
+ :q
+ q"
+-x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libX11.so"* 
"${x_libraries:-/usr/lib}/libX11.so"* 2>/dev/null | sed -e 
\"${soname_script}\"`"
++x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libX11.so"* 
"${x_libraries:-/usr/lib}/libX11.so"* 2>/dev/null | sed 1q`"
+ AC_DEFINE_UNQUOTED([LIBX11_SO], "${x_lib_location:-libX11.so}", [The soname 
of libX11, needed for dlopen()])
+-x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libXv.so"*  
"${x_libraries:-/usr/lib}/libXv.so"*  2>/dev/null | sed -e 
\"${soname_script}\"`"
++x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libXv.so"*  
"${x_libraries:-/usr/lib}/libXv.so"*  2>/dev/null | sed 1q`"
+ AC_DEFINE_UNQUOTED([LIBXV_SO],  "${x_lib_location:-libXv.so}",  [The soname 
of libXv, needed for dlopen()])
+ 
+ 
+@@ -1264,7 +1268,7 @@ if test "x$enable_a52dec" = "xno"; then
+   AC_MSG_RESULT([a52dec support disabled])
+ elif test "x$external_a52dec" = "xyes"; then
+   have_a52="yes"
+-  AC_CHECK_HEADERS([a52dec/a52.h a52dec/a52_internal.h],, have_a52="no",
++  AC_CHECK_HEADERS([a52dec/a52.h],, have_a52="no",
+ [
+   #ifdef HAVE_SYS_TYPES_H
+   # include <sys/types.h>
+@@ -1355,9 +1359,10 @@ if test "x$with_mng" = "xyes"; then
+   AC_CHECK_LIB(mng, mng_initialize,
+       [ AC_CHECK_HEADER(libmng.h,
+               [ have_libmng=yes
+-                MNG_LIBS="-lmng" ], 
++                MNG_LIBS="-lmng -llcms -ljpeg -lz -lm" ], 
+               AC_MSG_RESULT([*** All libmng dependent parts will be disabled 
***]))],
+-      AC_MSG_RESULT([*** All libmng dependent parts will be disabled ***]))
++      AC_MSG_RESULT([*** All libmng dependent parts will be disabled ***]),
++      [-llcms -ljpeg -lz -lm])
+   AC_SUBST(MNG_LIBS)
+ else
+   have_libmng=no
+@@ -1550,6 +1555,28 @@ AM_CONDITIONAL([HAVE_JACK], [test "x$have_jack" = "xye
+ 
+ 
+ dnl ---------------------------------------------
++dnl sndio support
++dnl ---------------------------------------------
++
++AC_ARG_WITH([sndio],
++      AS_HELP_STRING([--without-sndio], [Build without sndio support]))
++
++if test "x$with_sndio" != "xno"; then
++   AC_CHECK_LIB(sndio, sio_open, [SNDIO_LIBS=-lsndio; have_sndio=yes],
++     [have_sndio=no])
++
++   if test "x$with_sndio" = "xyes" && test "x$have_sndio" = "xno"; then
++      AC_MSG_ERROR([sndio support requested, but sndio not found])
++   fi
++fi
++
++AM_CONDITIONAL([HAVE_SNDIO], [test "x$have_sndio" = "xyes"])
++
++AC_SUBST([SNDIO_CFLAGS])
++AC_SUBST([SNDIO_LIBS])
++
++
++dnl ---------------------------------------------
+ dnl gnome-vfs support
+ dnl ---------------------------------------------
+ 
+@@ -2513,7 +2540,7 @@ dnl ---------------------------------------------
+ 
+ XINE_BUILD_CC="`$CC -v 2>&1 | tail -1 2>/dev/null`"
+ XINE_BUILD_OS="`uname -s -r -m`"
+-XINE_BUILD_DATE="`date \"+%a %d %b %Y %T\"`"
++XINE_BUILD_DATE="`date "+%a %d %b %Y %T"`"
+ AC_SUBST(XINE_BUILD_CC)
+ AC_SUBST(XINE_BUILD_OS)
+ AC_SUBST(XINE_BUILD_DATE)
+@@ -2651,7 +2678,7 @@ case $host in
+      dnl FreeBSD (et al.) does not complete linking for shared objects when 
pthreads
+      dnl are requested, as different implementations are present; to avoid 
problems
+      dnl use -Wl,-z,defs only for those platform not behaving this way.
+-     *-freebsd*) ;;
++     *-freebsd*|*-openbsd*) ;;
+      *)
+       AC_TRY_LDFLAGS([-Wl,-z,defs], [NOUNDEF="-Wl,-z,defs"])
+       ;;
+@@ -3173,6 +3200,9 @@ if test "x$have_pulseaudio" = "xyes"; then
+ fi
+ if test "x$have_jack" = "xyes"; then
+   echo "   - Jack"
++fi
++if test "x$have_sndio" = "xyes"; then
++  echo "   - sndio"
+ fi
+ echo "---"
+ 
Index: patches/patch-m4_libFLAC_m4
===================================================================
RCS file: patches/patch-m4_libFLAC_m4
diff -N patches/patch-m4_libFLAC_m4
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-m4_libFLAC_m4 11 Dec 2008 05:06:03 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- m4/libFLAC.m4.orig Wed Dec 10 23:08:32 2008
++++ m4/libFLAC.m4      Wed Dec 10 23:08:58 2008
+@@ -21,7 +21,7 @@ AC_ARG_ENABLE(libFLACtest, AS_HELP_STRING([--disable-l
+     LIBFLAC_LIBS="-L$prefix/$XINE_LIBNAME"
+   fi
+ 
+-  LIBFLAC_LIBS="$LIBFLAC_LIBS -lFLAC -lm"
++  LIBFLAC_LIBS="$LIBFLAC_LIBS -lFLAC -logg -lm"
+ 
+   if test "x$libFLAC_includes" != "x" ; then
+     LIBFLAC_CFLAGS="-I$libFLAC_includes"
Index: patches/patch-src_audio_out_Makefile_in
===================================================================
RCS file: 
/cvs/ports/multimedia/xine-lib/patches/patch-src_audio_out_Makefile_in,v
retrieving revision 1.10
diff -u -p -r1.10 patch-src_audio_out_Makefile_in
--- patches/patch-src_audio_out_Makefile_in     2 Jul 2008 01:02:42 -0000       
1.10
+++ patches/patch-src_audio_out_Makefile_in     11 Dec 2008 05:24:05 -0000
@@ -1,7 +1,69 @@
 $OpenBSD: patch-src_audio_out_Makefile_in,v 1.10 2008/07/02 01:02:42 brad Exp $
---- src/audio_out/Makefile.in.orig     Sun Jun 29 13:13:02 2008
-+++ src/audio_out/Makefile.in  Sun Jun 29 20:54:11 2008
-@@ -632,7 +632,7 @@ xineplug_ao_out_sun_la_LDFLAGS = -avoid-version -modul
+--- src/audio_out/Makefile.in.orig     Thu Aug 14 17:18:39 2008
++++ src/audio_out/Makefile.in  Thu Dec 11 00:23:10 2008
+@@ -170,6 +170,18 @@ xineplug_ao_out_jack_la_LINK = $(LIBTOOL) --tag=CC $(A
+       $(xineplug_ao_out_jack_la_LDFLAGS) $(LDFLAGS) -o $@
+ @[EMAIL PROTECTED] = -rpath \
+ @HAVE_JACK_TRUE@      $(xineplugdir)
++xineplug_ao_out_sndio_la_DEPENDENCIES = $(XINE_LIB) \
++      $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
++am_xineplug_ao_out_sndio_la_OBJECTS =  \
++      xineplug_ao_out_sndio_la-audio_sndio_out.lo
++xineplug_ao_out_sndio_la_OBJECTS =  \
++      $(am_xineplug_ao_out_sndio_la_OBJECTS)
++xineplug_ao_out_sndio_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
++      $(LIBTOOLFLAGS) --mode=link $(CCLD) \
++      $(xineplug_ao_out_sndio_la_CFLAGS) $(CFLAGS) \
++      $(xineplug_ao_out_sndio_la_LDFLAGS) $(LDFLAGS) -o $@
[EMAIL PROTECTED]@am_xineplug_ao_out_sndio_la_rpath = -rpath \
[EMAIL PROTECTED]@      $(xineplugdir)
+ xineplug_ao_out_none_la_DEPENDENCIES = $(XINE_LIB) \
+       $(am__DEPENDENCIES_1)
+ am_xineplug_ao_out_none_la_OBJECTS =  \
+@@ -233,6 +245,7 @@ SOURCES = $(xineplug_ao_out_alsa_la_SOURCES) \
+       $(xineplug_ao_out_file_la_SOURCES) \
+       $(xineplug_ao_out_fusionsound_la_SOURCES) \
+       $(xineplug_ao_out_jack_la_SOURCES) \
++      $(xineplug_ao_out_sndio_la_SOURCES) \
+       $(xineplug_ao_out_none_la_SOURCES) \
+       $(xineplug_ao_out_oss_la_SOURCES) \
+       $(xineplug_ao_out_pulseaudio_la_SOURCES) \
+@@ -246,6 +259,7 @@ DIST_SOURCES = $(xineplug_ao_out_alsa_la_SOURCES) \
+       $(xineplug_ao_out_file_la_SOURCES) \
+       $(xineplug_ao_out_fusionsound_la_SOURCES) \
+       $(xineplug_ao_out_jack_la_SOURCES) \
++      $(xineplug_ao_out_sndio_la_SOURCES) \
+       $(xineplug_ao_out_none_la_SOURCES) \
+       $(xineplug_ao_out_oss_la_SOURCES) \
+       $(xineplug_ao_out_pulseaudio_la_SOURCES) \
+@@ -355,6 +369,8 @@ IRIXAL_LIBS = @IRIXAL_LIBS@
+ IRIXAL_STATIC_LIB = @IRIXAL_STATIC_LIB@
+ JACK_CFLAGS = @JACK_CFLAGS@
+ JACK_LIBS = @JACK_LIBS@
++SNDIO_CFLAGS = @SNDIO_CFLAGS@
++SNDIO_LIBS = @SNDIO_LIBS@
+ KSTAT_LIBS = @KSTAT_LIBS@
+ LDFLAGS = @LDFLAGS@
+ LIBCDIO_CFLAGS = @LIBCDIO_CFLAGS@
+@@ -583,6 +599,7 @@ EXTRA_DIST = audio_irixal_out.c
+ @[EMAIL PROTECTED] = xineplug_ao_out_pulseaudio.la
+ @[EMAIL PROTECTED] = xineplug_ao_out_fusionsound.la
+ @[EMAIL PROTECTED] = xineplug_ao_out_jack.la
[EMAIL PROTECTED]@sndio_module = xineplug_ao_out_sndio.la
+ 
+ # IMPORTANT:
+ # ---------
+@@ -600,7 +617,8 @@ xineplug_LTLIBRARIES = xineplug_ao_out_none.la xineplu
+       $(pulseaudio_module) \
+       $(directx2_module)      \
+       $(fusionsound_module) \
+-      $(jack_module)
++      $(jack_module) \
++      $(sndio_module)
+ 
+ xineplug_ao_out_none_la_SOURCES = audio_none_out.c
+ xineplug_ao_out_none_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
+@@ -632,7 +650,7 @@ xineplug_ao_out_sun_la_LDFLAGS = -avoid-version -modul
  #xineplug_ao_out_irixal_la_CFLAGS = $(VISIBILITY_FLAG) $(IRIXAL_CFLAGS)
  #xineplug_ao_out_irixal_la_LDFLAGS = -avoid-version -module
  xineplug_ao_out_arts_la_SOURCES = audio_arts_out.c
@@ -10,3 +72,45 @@ $OpenBSD: patch-src_audio_out_Makefile_i
  xineplug_ao_out_arts_la_CFLAGS = $(VISIBILITY_FLAG) $(ARTS_CFLAGS)
  xineplug_ao_out_arts_la_LDFLAGS = -avoid-version -module
  xineplug_ao_out_directx_la_SOURCES = audio_directx_out.c
+@@ -667,6 +685,10 @@ xineplug_ao_out_jack_la_SOURCES = audio_jack_out.c
+ xineplug_ao_out_jack_la_LIBADD = $(XINE_LIB) $(JACK_LIBS) $(LTLIBINTL)
+ xineplug_ao_out_jack_la_CFLAGS = $(VISIBILITY_FLAG) $(JACK_CFLAGS)
+ xineplug_ao_out_jack_la_LDFLAGS = -avoid-version -module
++xineplug_ao_out_sndio_la_SOURCES = audio_sndio_out.c
++xineplug_ao_out_sndio_la_LIBADD = $(XINE_LIB) $(SNDIO_LIBS)
++xineplug_ao_out_sndio_la_CFLAGS = $(VISIBILITY_FLAG) $(SNDIO_CFLAGS)
++xineplug_ao_out_sndio_la_LDFLAGS = -avoid-version -module
+ all: all-am
+ 
+ .SUFFIXES:
+@@ -745,6 +767,8 @@ xineplug_ao_out_fusionsound.la: $(xineplug_ao_out_fusi
+       $(xineplug_ao_out_fusionsound_la_LINK) 
$(am_xineplug_ao_out_fusionsound_la_rpath) 
$(xineplug_ao_out_fusionsound_la_OBJECTS) 
$(xineplug_ao_out_fusionsound_la_LIBADD) $(LIBS)
+ xineplug_ao_out_jack.la: $(xineplug_ao_out_jack_la_OBJECTS) 
$(xineplug_ao_out_jack_la_DEPENDENCIES) 
+       $(xineplug_ao_out_jack_la_LINK) $(am_xineplug_ao_out_jack_la_rpath) 
$(xineplug_ao_out_jack_la_OBJECTS) $(xineplug_ao_out_jack_la_LIBADD) $(LIBS)
++xineplug_ao_out_sndio.la: $(xineplug_ao_out_sndio_la_OBJECTS) 
$(xineplug_ao_out_sndio_la_DEPENDENCIES)
++      $(xineplug_ao_out_sndio_la_LINK) $(am_xineplug_ao_out_sndio_la_rpath) 
$(xineplug_ao_out_sndio_la_OBJECTS) $(xineplug_ao_out_sndio_la_LIBADD) $(LIBS)
+ xineplug_ao_out_none.la: $(xineplug_ao_out_none_la_OBJECTS) 
$(xineplug_ao_out_none_la_DEPENDENCIES) 
+       $(xineplug_ao_out_none_la_LINK) -rpath $(xineplugdir) 
$(xineplug_ao_out_none_la_OBJECTS) $(xineplug_ao_out_none_la_LIBADD) $(LIBS)
+ xineplug_ao_out_oss.la: $(xineplug_ao_out_oss_la_OBJECTS) 
$(xineplug_ao_out_oss_la_DEPENDENCIES) 
+@@ -769,6 +793,7 @@ distclean-compile:
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
[EMAIL PROTECTED]@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@
+@@ -857,6 +882,13 @@ xineplug_ao_out_jack_la-audio_jack_out.lo: audio_jack_
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@     source='audio_jack_out.c' 
object='xineplug_ao_out_jack_la-audio_jack_out.lo' libtool=yes @AMDEPBACKSLASH@
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@     DEPDIR=$(DEPDIR) $(CCDEPMODE) 
$(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) 
$(CPPFLAGS) $(xineplug_ao_out_jack_la_CFLAGS) $(CFLAGS) -c -o 
xineplug_ao_out_jack_la-audio_jack_out.lo `test -f 'audio_jack_out.c' || echo 
'$(srcdir)/'`audio_jack_out.c
++
++xineplug_ao_out_sndio_la-audio_sndio_out.lo: audio_sndio_out.c
[EMAIL PROTECTED]@      $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) 
$(CPPFLAGS) $(xineplug_ao_out_sndio_la_CFLAGS) $(CFLAGS) -MT 
xineplug_ao_out_sndio_la-audio_sndio_out.lo -MD -MP -MF 
$(DEPDIR)/xineplug_ao_out_sndio_la-audio_sndio_out.Tpo -c -o 
xineplug_ao_out_sndio_la-audio_sndio_out.lo `test -f 'audio_sndio_out.c' || 
echo '$(srcdir)/'`audio_sndio_out.c
[EMAIL PROTECTED]@      mv -f 
$(DEPDIR)/xineplug_ao_out_sndio_la-audio_sndio_out.Tpo 
$(DEPDIR)/xineplug_ao_out_sndio_la-audio_sndio_out.Plo
[EMAIL PROTECTED]@@am__fastdepCC_FALSE@ source='audio_sndio_out.c' 
object='xineplug_ao_out_sndio_la-audio_sndio_out.lo' libtool=yes 
@AMDEPBACKSLASH@
[EMAIL PROTECTED]@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) 
$(depcomp) @AMDEPBACKSLASH@
[EMAIL PROTECTED]@      $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) 
$(CPPFLAGS) $(xineplug_ao_out_sndio_la_CFLAGS) $(CFLAGS) -c -o 
xineplug_ao_out_sndio_la-audio_sndio_out.lo `test -f 'audio_sndio_out.c' || 
echo '$(srcdir)/'`audio_sndio_out.c
+ 
+ xineplug_ao_out_none_la-audio_none_out.lo: audio_none_out.c
+ @am__fastdepCC_TRUE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) 
$(CPPFLAGS) $(xineplug_ao_out_none_la_CFLAGS) $(CFLAGS) -MT 
xineplug_ao_out_none_la-audio_none_out.lo -MD -MP -MF 
$(DEPDIR)/xineplug_ao_out_none_la-audio_none_out.Tpo -c -o 
xineplug_ao_out_none_la-audio_none_out.lo `test -f 'audio_none_out.c' || echo 
'$(srcdir)/'`audio_none_out.c
Index: pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/multimedia/xine-lib/pkg/PLIST-main,v
retrieving revision 1.8
diff -u -p -r1.8 PLIST-main
--- pkg/PLIST-main      18 Jun 2008 01:26:41 -0000      1.8
+++ pkg/PLIST-main      11 Dec 2008 05:18:57 -0000
@@ -59,6 +59,7 @@ lib/xine/plugins/${XINEAPI_REV}/post/xin
 @comment lib/xine/plugins/${XINEAPI_REV}/vidix/
 lib/xine/plugins/${XINEAPI_REV}/xineplug_ao_out_file.so
 lib/xine/plugins/${XINEAPI_REV}/xineplug_ao_out_none.so
+lib/xine/plugins/${XINEAPI_REV}/xineplug_ao_out_sndio.so
 lib/xine/plugins/${XINEAPI_REV}/xineplug_ao_out_sun.so
 lib/xine/plugins/${XINEAPI_REV}/xineplug_decode_a52.so
 lib/xine/plugins/${XINEAPI_REV}/xineplug_decode_bitplane.so

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply via email to