summaryrefslogtreecommitdiff
path: root/lib/libsndio
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-11-20 16:31:27 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-11-20 16:31:27 +0000
commit5f2a172e066c1c8dff382fd966f5373df82983bc (patch)
treea92731702038054fa88f361b6d8182986de258f4 /lib/libsndio
parent11474d6c12facb2de05a132cdf2e234f6410f5fc (diff)
make both aucat(1) and audio(4) backends use the AUDIODEVICE env
variable to determine the socket or the device to use. Allow choosing the when aucat(1) is used too. Noticed and tested by naddy@
Diffstat (limited to 'lib/libsndio')
-rw-r--r--lib/libsndio/sndio.c4
-rw-r--r--lib/libsndio/sun.c9
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/libsndio/sndio.c b/lib/libsndio/sndio.c
index afc9b36013c..cccc38905ee 100644
--- a/lib/libsndio/sndio.c
+++ b/lib/libsndio/sndio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sndio.c,v 1.6 2008/11/11 19:39:35 ratchov Exp $ */
+/* $OpenBSD: sndio.c,v 1.7 2008/11/20 16:31:26 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -164,6 +164,8 @@ sio_open(char *str, unsigned mode, int nbio)
if ((mode & (SIO_PLAY | SIO_REC)) == 0)
return NULL;
+ if (str == NULL)
+ str = getenv("AUDIODEVICE");
hdl = sio_open_aucat(str, mode, nbio);
if (hdl != NULL)
return hdl;
diff --git a/lib/libsndio/sun.c b/lib/libsndio/sun.c
index 079ec9a5391..5b4db13842b 100644
--- a/lib/libsndio/sun.c
+++ b/lib/libsndio/sun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sun.c,v 1.6 2008/11/20 08:32:03 ratchov Exp $ */
+/* $OpenBSD: sun.c,v 1.7 2008/11/20 16:31:26 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -453,11 +453,8 @@ sio_open_sun(char *path, unsigned mode, int nbio)
return NULL;
sio_create(&hdl->sa, &sun_ops, mode, nbio);
- if (path == NULL) {
- path = getenv("AUDIODEVICE");
- if (path == NULL)
- path = SIO_SUN_PATH;
- }
+ if (path == NULL)
+ path = SIO_SUN_PATH;
if (mode == (SIO_PLAY | SIO_REC))
flags = O_RDWR;
else