On Sun, 14 Dec 2008, Jacob Meuser wrote:
> probably. someone who actualy uses esound for other than testing
> if esound works want to take care of that? thanks.
I do use esound on all my workstations.
Here's an update to latest version with your sndio backend.
It works for me...
Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/esound/Makefile,v
retrieving revision 1.44
diff -u -r1.44 Makefile
--- Makefile 31 Mar 2008 01:05:54 -0000 1.44
+++ Makefile 14 Dec 2008 12:45:04 -0000
@@ -3,7 +3,7 @@
COMMENT= sound library for Enlightenment
-DISTNAME= esound-0.2.38
+DISTNAME= esound-0.2.41
PKGNAME= ${DISTNAME}v0
SHARED_LIBS += esd 2.40 # .2.38
CATEGORIES= audio
@@ -18,7 +18,7 @@
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
-WANTLIB= c m wrap
+WANTLIB= c m sndio wrap
FLAVORS= arts
FLAVOR?=
@@ -47,10 +47,9 @@
esdconfdir=${PREFIX}/share/examples/esound
post-extract:
- @cp -f ${FILESDIR}/audio_sun.c ${WRKSRC}
+ @cp -f ${FILESDIR}/audio_sndio.c ${WRKSRC}
pre-configure:
- @perl -pi -e 's|_LOCALBASE_|${LOCALBASE}|' \
- ${WRKSRC}/test-script
+ ${SUBST_CMD} ${WRKSRC}/test-script
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/audio/esound/distinfo,v
retrieving revision 1.9
diff -u -r1.9 distinfo
--- distinfo 31 Mar 2008 01:05:54 -0000 1.9
+++ distinfo 14 Dec 2008 12:45:04 -0000
@@ -1,5 +1,5 @@
-MD5 (esound-0.2.38.tar.gz) = d8TpgFoBf7oGVSSH3zxmYg==
-RMD160 (esound-0.2.38.tar.gz) = OwL3H38UZcIECjzwETbzHWJnfmE=
-SHA1 (esound-0.2.38.tar.gz) = QFQ9y1sVcsdwKwuwt1aEQEY1G6U=
-SHA256 (esound-0.2.38.tar.gz) = SKOU83d2M2JmBnlKUpTwHilOERTWzD54lMapDyImsGc=
-SIZE (esound-0.2.38.tar.gz) = 519964
+MD5 (esound-0.2.41.tar.gz) = PYlz7YcFPXrMH01EryxGiA==
+RMD160 (esound-0.2.41.tar.gz) = 6TxjJLSj6DIFcCsGLcFKwQ2Kxso=
+SHA1 (esound-0.2.41.tar.gz) = sq9p63wKBpdyCqGrkoXBbcvYvIY=
+SHA256 (esound-0.2.41.tar.gz) = KjLev/636gdKZlckHwIq8CrF6xYPiyepmr+qXWnOI84=
+SIZE (esound-0.2.41.tar.gz) = 518632
Index: files/audio_sndio.c
===================================================================
RCS file: files/audio_sndio.c
diff -N files/audio_sndio.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/audio_sndio.c 14 Dec 2008 12:45:04 -0000
@@ -0,0 +1,134 @@
+/* $OpenBSD$ */
+
+/*
+ * Copyright (c) 2008 Jacob Meuser <[email protected]>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "config.h"
+
+#include <sndio.h>
+
+struct sio_hdl *hdl = NULL;
+
+#define ARCH_esd_audio_close
+void esd_audio_close()
+{
+ if (hdl != NULL) {
+ sio_close(hdl);
+ hdl = NULL;
+ }
+}
+
+#define ARCH_esd_audio_open
+int esd_audio_open()
+{
+ char *device;
+ struct sio_par par;
+ int mode = SIO_PLAY;
+
+ if (hdl != NULL) {
+ fprintf(stderr, "sndio already opened\n");
+ return(1);
+ }
+
+ sio_initpar(&par);
+
+ if ((esd_audio_format & ESD_MASK_FUNC) == ESD_RECORD)
+ mode |= SIO_REC;
+
+ device = esd_audio_device ? esd_audio_device : getenv("AUDIODEVICE");
+ if ((hdl = sio_open(device, mode, 0)) == NULL) {
+ fprintf(stderr, "sio_open failed\n");
+ goto bad;
+ }
+
+ par.le = (BYTE_ORDER == 4321) ? 0 : 1;
+ if ((esd_audio_format & ESD_MASK_BITS) == ESD_BITS16) {
+ par.bits = 16;
+ par.sig = 1;
+ } else {
+ par.bits = 8;
+ par.sig = 0;
+ }
+
+ par.pchan = (((esd_audio_format & ESD_MASK_CHAN) == ESD_STEREO) ? 2 : 1);
+ if (mode & SIO_REC)
+ par.rchan = par.pchan;
+
+ par.bufsz = ESD_BUF_SIZE;
+
+ par.rate = esd_audio_rate;
+
+ if (!sio_setpar(hdl, &par)) {
+ fprintf(stderr, "sio_setpar failed\n");
+ goto bad;
+ }
+
+ if (!sio_getpar(hdl, &par)) {
+ fprintf(stderr, "sio_getpar failed\n");
+ goto bad;
+ }
+
+ /* check that the actual parameters are what we asked for */
+ if (fabs(par.rate - esd_audio_rate) > esd_audio_rate * 0.05) {
+ fprintf(stderr, "Unsupported rate: %i Hz\n", esd_audio_rate);
+ goto bad;
+ }
+ if ((esd_audio_format & ESD_MASK_BITS) == ESD_BITS16) {
+ if (par.sig != 1 || par.bits != 16) {
+ fprintf(stderr, "Unsupported bits: 16\n");
+ goto bad;
+ }
+ } else {
+ if (par.sig != 0 || par.bits != 8) {
+ fprintf(stderr, "Unsupported bits: 8\n");
+ goto bad;
+ }
+ }
+ if ((esd_audio_format & ESD_MASK_CHAN) == ESD_STEREO) {
+ if (par.pchan != 2) {
+ fprintf(stderr, "Unsupported channels: 2\n");
+ goto bad;
+ }
+ } else {
+ if (par.pchan != 1) {
+ fprintf(stderr, "Unsupported channels: 1\n");
+ goto bad;
+ }
+ }
+
+ if (!sio_start(hdl)) {
+ fprintf(stderr, "sio_start failed\n");
+ goto bad;
+ }
+
+ return(1);
+
+bad:
+ esd_audio_close();
+ return(-1);
+}
+
+#define ARCH_esd_audio_write
+int esd_audio_write(void *buffer, int buf_size)
+{
+ return sio_write(hdl, buffer, buf_size);
+}
+
+#define ARCH_esd_audio_read
+int esd_audio_read(void *buffer, int buf_size)
+{
+ return sio_read(hdl, buffer, buf_size);
+}
Index: files/audio_sun.c
===================================================================
RCS file: files/audio_sun.c
diff -N files/audio_sun.c
--- files/audio_sun.c 31 Mar 2008 01:05:54 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,165 +0,0 @@
-/* $OpenBSD: audio_sun.c,v 1.4 2008/03/31 01:05:54 jakemsr Exp $ */
-
-/*
- * Copyright (c) 2002 CubeSoft Communications, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistribution of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Neither the name of CubeSoft Communications, nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
- * USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/audioio.h>
-#include <string.h>
-
-static void sun_panic(int fd, char *s)
-{
- perror(s);
- close(fd);
- esd_audio_fd = -1;
-}
-
-#define ARCH_esd_audio_devices
-const char *esd_audio_devices()
-{
- return "/dev/audio";
-}
-
-
-#define ARCH_esd_audio_open
-int esd_audio_open()
-{
- const char *device;
- int afd = -1;
- int fmt = 0, channels = 0, bits = 0;
- int mode = O_WRONLY;
- audio_info_t info;
-
- AUDIO_INITINFO(&info);
-
- /* set the appropriate mode */
- if((esd_audio_format & ESD_MASK_FUNC) == ESD_RECORD) {
- mode = O_RDWR;
- info.mode = AUMODE_PLAY | AUMODE_PLAY_ALL | AUMODE_RECORD;
- } else {
- info.mode = AUMODE_PLAY | AUMODE_PLAY_ALL;
- }
-
- /* open the sound device */
- device = esd_audio_device ? esd_audio_device : "/dev/audio";
- if ((afd = open(device, mode, 0)) == -1) {
- perror(device);
- return( -2 );
- }
-
- /* set the requested mode */
- if(ioctl(afd, AUDIO_SETINFO, &info) < 0) {
- sun_panic(afd, "AUDIO_SETINFO");
- return(-1);
- }
-
- /* set full-duplex mode if we are recording */
- if ( (esd_audio_format & ESD_MASK_FUNC) == ESD_RECORD ) {
- if (ioctl(afd, AUDIO_SETFD, 1) == -1) {
- sun_panic(afd, "AUDIO_SETFD");
- return(-1);
- }
- }
-
- /* pick a supported encoding */
- if ((esd_audio_format & ESD_MASK_BITS) == ESD_BITS16) {
- bits = 16;
- fmt = (BYTE_ORDER == 4321) ?
- AUDIO_ENCODING_SLINEAR_BE : AUDIO_ENCODING_SLINEAR_LE;
- } else {
- bits = 8;
- fmt = (BYTE_ORDER == 4321) ?
- AUDIO_ENCODING_ULINEAR_BE : AUDIO_ENCODING_ULINEAR_LE;
- }
- info.play.encoding = fmt;
- info.play.precision = bits;
- if(ioctl(afd, AUDIO_SETINFO, &info) == -1) {
- fprintf(stderr, "Unsupported encoding: %i-bit (0x%x)\n",
- bits, fmt);
- sun_panic(afd, "SETINFO");
- return(-1);
- }
-
- /* number of channels */
- channels = (((esd_audio_format & ESD_MASK_CHAN) == ESD_STEREO)
- ? /* stereo */ 2
- : /* mono */ 1);
-
- info.play.channels = channels;
- if((esd_audio_format & ESD_MASK_FUNC) == ESD_RECORD) {
- info.record.channels = channels;
- }
- if(ioctl(afd, AUDIO_SETINFO, &info) == -1) {
- fprintf(stderr, "Unsupported channel count: %d\n",
- channels);
- sun_panic(afd, "SETINFO");
- return(-1);
- }
-
- /* blocksize, sync to internal esd buffer size */
- info.blocksize = ESD_BUF_SIZE;
- info.hiwat = 4;
- if(ioctl(afd, AUDIO_SETINFO, &info) < 0) {
- fprintf(stderr, "Unsupported blocksize: %d\n",
- info.blocksize);
- sun_panic(afd, "SETINFO");
- return(-1);
- }
-
- /* finally, set the sample rate */
- info.play.sample_rate = esd_audio_rate;
- if(ioctl(afd, AUDIO_SETINFO, &info) < 0 ||
- fabs(info.play.sample_rate - esd_audio_rate) > esd_audio_rate * 0.05) {
- fprintf(stderr, "Unsupported rate: %i Hz\n", esd_audio_rate);
- sun_panic(afd, "SETINFO");
- return(-1);
- }
-
- return(esd_audio_fd = afd);
-}
-
-#define ARCH_esd_audio_pause
-void esd_audio_pause()
-{
- audio_info_t info;
- int afd = esd_audio_fd;
-
- AUDIO_INITINFO(&info);
-
- if(ioctl(afd, AUDIO_GETINFO, &info) < 0) {
- sun_panic(afd, "AUDIO_GETINFO");
- return;
- }
-
- if((info.mode & AUMODE_PLAY) == AUMODE_PLAY)
- info.play.pause = !info.play.pause;
- if((info.mode & AUMODE_RECORD) == AUMODE_RECORD)
- info.record.pause = !info.record.pause;
-
- return;
-}
Index: patches/patch-audio_c
===================================================================
RCS file: /cvs/ports/audio/esound/patches/patch-audio_c,v
retrieving revision 1.5
diff -u -r1.5 patch-audio_c
--- patches/patch-audio_c 31 Mar 2008 01:05:54 -0000 1.5
+++ patches/patch-audio_c 14 Dec 2008 12:45:04 -0000
@@ -1,7 +1,7 @@
$OpenBSD: patch-audio_c,v 1.5 2008/03/31 01:05:54 jakemsr Exp $
---- audio.c.orig Thu Apr 19 17:43:59 2007
-+++ audio.c Sat Jun 2 23:15:49 2007
-@@ -20,34 +20,7 @@ static int esd_audio_fd = -1;
+--- audio.c.orig Tue Nov 18 21:35:19 2008
++++ audio.c Sun Dec 14 13:40:03 2008
+@@ -24,34 +24,7 @@ static int esd_write_size = ESD_BUF_SIZE;
/*******************************************************************/
/* returns audio_fd for use by main prog - platform dependent */
@@ -33,7 +33,7 @@
-#else
-# include "audio_none.c"
-#endif
-+#include "audio_sun.c"
++#include "audio_sndio.c"
/*******************************************************************/
/* display available devices */
Index: patches/patch-clients_c
===================================================================
RCS file: /cvs/ports/audio/esound/patches/patch-clients_c,v
retrieving revision 1.1
diff -u -r1.1 patch-clients_c
--- patches/patch-clients_c 31 Mar 2008 01:05:54 -0000 1.1
+++ patches/patch-clients_c 14 Dec 2008 12:45:04 -0000
@@ -1,7 +1,7 @@
$OpenBSD: patch-clients_c,v 1.1 2008/03/31 01:05:54 jakemsr Exp $
---- clients.c.orig Sun Mar 9 16:25:22 2008
-+++ clients.c Sun Mar 9 16:28:43 2008
-@@ -141,9 +141,9 @@ int get_new_clients( int listen )
+--- clients.c.orig Sun Dec 14 13:33:21 2008
++++ clients.c Sun Dec 14 13:35:02 2008
+@@ -143,9 +143,9 @@ int get_new_clients( int listen )
struct sockaddr_in incoming;
#if defined (ENABLE_IPV6)
struct sockaddr_in6 incoming6;
@@ -12,13 +12,4 @@
+ socklen_t size_in = sizeof(struct sockaddr_in);
esd_client_t *new_client = NULL;
- unsigned long addr;
-@@ -186,7 +186,7 @@ int get_new_clients( int listen )
- if (esd_use_tcpip)
- {
- struct request_info req;
-- struct servent *serv;
-+ /* struct servent *serv; */
-
- request_init( &req, RQ_DAEMON, "esound", RQ_FILE, fd, NULL );
- fromhost( &req );
+ short port;
Index: patches/patch-configure_ac
===================================================================
RCS file: /cvs/ports/audio/esound/patches/patch-configure_ac,v
retrieving revision 1.3
diff -u -r1.3 patch-configure_ac
--- patches/patch-configure_ac 31 Mar 2008 01:05:54 -0000 1.3
+++ patches/patch-configure_ac 14 Dec 2008 12:45:04 -0000
@@ -1,7 +1,15 @@
$OpenBSD: patch-configure_ac,v 1.3 2008/03/31 01:05:54 jakemsr Exp $
---- configure.ac.orig Thu May 3 13:47:30 2007
-+++ configure.ac Sun Mar 9 20:03:26 2008
-@@ -301,21 +301,16 @@ if test "x$enable_local_sound" = "xyes"; then
+--- configure.ac.orig Tue Nov 18 21:35:33 2008
++++ configure.ac Sun Dec 14 13:40:08 2008
+@@ -46,6 +46,7 @@ AC_C_INLINE
+
+ dnl Check for system libs needed
+
++LIBS="$LIBS -lsndio"
+ AC_FUNC_ALLOCA
+ AC_CHECK_FUNCS(setenv putenv fchown fchmod gethostbyname2)
+ AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
+@@ -299,21 +300,16 @@ if test "x$enable_local_sound" = "xyes"; then
if test "x$HAVE_ARTS" = "xyes"; then
found_sound=yes
CFLAGS="$CFLAGS $ARTSC_CFLAGS"
@@ -24,7 +32,7 @@
AC_CHECK_FUNC(ALnewconfig,,[AC_CHECK_LIB(audio,ALnewconfig)])
if test "x$enable_alsa" = "xyes"; then
AC_CHECK_FUNC(snd_cards,,[AC_CHECK_LIB(sound,snd_cards)])
-@@ -393,7 +388,8 @@ if test "x$with_libwrap" = "xyes"; then
+@@ -391,7 +387,8 @@ if test "x$with_libwrap" = "xyes"; then
wrap_ok=no
AC_TRY_LINK(
@@ -34,7 +42,7 @@
#include <syslog.h>
int allow_severity = LOG_INFO;
int deny_severity = LOG_WARNING;],
-@@ -403,7 +399,8 @@ int deny_severity = LOG_WARNING;],
+@@ -401,7 +398,8 @@ int deny_severity = LOG_WARNING;],
wrap_ok=yes],
[LIBS="$LIBS -lnsl"
AC_TRY_LINK(
Index: patches/patch-esd_c
===================================================================
RCS file: /cvs/ports/audio/esound/patches/patch-esd_c,v
retrieving revision 1.3
diff -u -r1.3 patch-esd_c
--- patches/patch-esd_c 31 Mar 2008 01:05:54 -0000 1.3
+++ patches/patch-esd_c 14 Dec 2008 12:45:04 -0000
@@ -1,7 +1,7 @@
$OpenBSD: patch-esd_c,v 1.3 2008/03/31 01:05:54 jakemsr Exp $
---- esd.c.orig Thu May 3 13:28:35 2007
-+++ esd.c Sun Mar 9 21:54:55 2008
-@@ -274,12 +274,12 @@ struct stat dir_stats;
+--- esd.c.orig Tue Nov 18 21:35:19 2008
++++ esd.c Sun Dec 14 13:40:03 2008
+@@ -287,12 +287,12 @@ struct stat dir_stats;
#if defined(S_ISVTX)
#define ESD_UNIX_SOCKET_DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|\
Index: patches/patch-esdlib_c
===================================================================
RCS file: /cvs/ports/audio/esound/patches/patch-esdlib_c,v
retrieving revision 1.1
diff -u -r1.1 patch-esdlib_c
--- patches/patch-esdlib_c 31 Mar 2008 01:05:54 -0000 1.1
+++ patches/patch-esdlib_c 14 Dec 2008 12:45:04 -0000
@@ -1,10 +1,10 @@
$OpenBSD: patch-esdlib_c,v 1.1 2008/03/31 01:05:54 jakemsr Exp $
---- esdlib.c.orig Thu Apr 19 07:43:59 2007
-+++ esdlib.c Sun Mar 9 23:39:06 2008
-@@ -769,7 +769,7 @@ int esd_open_sound( const char *host )
-
- sprintf(cmd, "%s/esd %s -spawnfd %d", SERVERDIR,
esd_spawn_options?esd_spawn_options:"", esd_pipe[1]);
-
+--- esdlib.c.orig Sun Dec 14 13:35:12 2008
++++ esdlib.c Sun Dec 14 13:35:42 2008
+@@ -935,7 +935,7 @@ int esd_open_sound( const char *rhost )
+ * not included in the waiting time
+ */
+ setsid();
- execl("/bin/sh", "/bin/sh", "-c", cmd, NULL);
+ execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL);
perror("execl");
Index: patches/patch-test-script
===================================================================
RCS file: /cvs/ports/audio/esound/patches/patch-test-script,v
retrieving revision 1.5
diff -u -r1.5 patch-test-script
--- patches/patch-test-script 31 Mar 2008 01:05:54 -0000 1.5
+++ patches/patch-test-script 14 Dec 2008 12:45:04 -0000
@@ -3,7 +3,7 @@
+++ test-script Sun Mar 9 16:23:07 2008
@@ -1,4 +1,4 @@
-#!/bin/tcsh
-+#!/usr/local/bin/tcsh
++#!${LOCALBASE}/bin/tcsh
echo welcome to the test.
echo ""
Index: patches/patch-util_c
===================================================================
RCS file: /cvs/ports/audio/esound/patches/patch-util_c,v
retrieving revision 1.5
diff -u -r1.5 patch-util_c
--- patches/patch-util_c 31 Mar 2008 01:05:54 -0000 1.5
+++ patches/patch-util_c 14 Dec 2008 12:45:04 -0000
@@ -1,6 +1,6 @@
$OpenBSD: patch-util_c,v 1.5 2008/03/31 01:05:54 jakemsr Exp $
---- util.c.orig Thu Apr 19 17:43:59 2007
-+++ util.c Sat Jun 2 23:38:31 2007
+--- util.c.orig Sun Dec 14 13:35:48 2008
++++ util.c Sun Dec 14 13:39:45 2008
@@ -1,5 +1,8 @@
#include "config.h"
#include "esd.h"
@@ -10,34 +10,32 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <stdlib.h>
-@@ -23,38 +26,31 @@ have_ipv6(void) {
+@@ -24,36 +27,31 @@ have_ipv6(void) {
const char*
esd_get_socket_dirname (void)
{
-- const char *audiodev;
+- const char *audiodev = NULL;
- static char *dirname = NULL;
+ static char *sockdir = NULL, sockdirbuf[PATH_MAX];
+ struct passwd *pw;
-- if (dirname == NULL) {
-- if (!(audiodev = getenv("AUDIODEV"))) {
-- audiodev = "";
-- } else {
-- char *newdev = strrchr(audiodev, '/');
-- if (newdev != NULL) {
-- audiodev = newdev++;
-- }
-- }
-- dirname = malloc(strlen(audiodev) + sizeof("/tmp/.esd"));
-- strcpy(dirname, "/tmp/.esd");
-- strcat(dirname, audiodev);
+- if (dirname == NULL) {
+- if ((audiodev = getenv("AUDIODEV"))) {
+- char *newdev = strrchr(audiodev, '/');
+- if (newdev != NULL) {
+- audiodev = newdev++;
+- }
+- } else
+- audiodev = "";
+- dirname = malloc(strlen(audiodev) + 40);
+- sprintf (dirname, "/tmp/.esd%s-%i", audiodev, getuid());
+ if (sockdir != NULL)
+ return sockdir;
+ pw = getpwuid(getuid());
+ if (pw == NULL || pw->pw_dir == NULL) {
+ fprintf(stderr, "esd: could not find home directory\n");
+ exit(1);
- }
+ }
-
- return dirname;
+ snprintf(sockdirbuf, sizeof(sockdirbuf), "%s/.esd", pw->pw_dir);
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/audio/esound/pkg/PLIST,v
retrieving revision 1.18
diff -u -r1.18 PLIST
--- pkg/PLIST 31 Mar 2008 01:05:54 -0000 1.18
+++ pkg/PLIST 14 Dec 2008 12:45:04 -0000
@@ -1,14 +1,14 @@
@comment $OpenBSD: PLIST,v 1.18 2008/03/31 01:05:54 jakemsr Exp $
-bin/esd
+...@bin bin/esd
bin/esd-config
-bin/esdcat
-bin/esdctl
-bin/esdfilt
-bin/esdloop
-bin/esdmon
-bin/esdplay
-bin/esdrec
-bin/esdsample
+...@bin bin/esdcat
+...@bin bin/esdctl
+...@bin bin/esdfilt
+...@bin bin/esdloop
+...@bin bin/esdmon
+...@bin bin/esdplay
+...@bin bin/esdrec
+...@bin bin/esdsample
include/esd.h
lib/libesd.a
lib/libesd.la
--
Antoine