[Liboss-commit] CVS: liboss/lib esddsp.c,1.20,1.21
Brought to you by:
thesin
|
From: Alexander S. <mrv...@us...> - 2002-12-12 01:38:19
|
Update of /cvsroot/liboss/liboss/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv13630/lib
Modified Files:
esddsp.c
Log Message:
Reverting dsp_init() back because the 'new method' was a no-op, and fixed up configure.in based on advice from 'autoscan'
Index: esddsp.c
===================================================================
RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- esddsp.c 14 Nov 2002 22:38:44 -0000 1.20
+++ esddsp.c 12 Dec 2002 01:19:35 -0000 1.21
@@ -37,6 +37,9 @@
#include <sys/stat.h>
#include <stdio.h>
#include <sys/errno.h>
+#ifdef HAVE_SYS_SYSCALL_H
+#include <sys/syscall.h>
+#endif
#include "liboss/soundcard.h"
#include "liboss/audioio.h"
@@ -95,41 +98,19 @@
{
if (!ident)
{
- /* FIXME - the value of getenv is AFAIK guranteed to stay
- * current during the whole program run time. So in theory the
- * next three lines could be replaced by something like this:
- * - Max horn
- *
- * char *str = getenv ("ESDDSP_NAME");
- * if (!str)
- * str = "esddsp";
- *
- * If anybody can test it...
- */
-
- char *str = getenv ("ESDDSP_NAME");
- if (!str)
- str = "esddsp";
-
-/* OLD METHOD
-
- char *str = getenv ("ESDDSP_NAME");
+ char *str = getenv ("ESDDSP_NAME");
ident = malloc (ESD_NAME_MAX);
strncpy (ident, (str ? str : "esddsp"), ESD_NAME_MAX);
+
+ str = getenv ("HOME");
use_mixer = 1;
-
- str = getenv ("HOME");
- FIXME - if $HOME is not set, mixer will stay NULL, but is passed later
- on to open, leading to a potential crash.
-
if (str)
{
mixer = malloc (strlen (str) + strlen (ident) + 10);
sprintf (mixer, "%s/.esddsp_%s", str, ident);
}
-*/
}
}
@@ -182,7 +163,8 @@
mode = va_arg (args, int);
- if (!strcmp (pathname, "/dev/dsp"))
+ if (!strcmp (pathname, "/dev/dsp") || !strcmp(pathname,"/dev/dspW") ||
+!strcmp(pathname,"/dev/sound/dsp"))
{
if (!getenv ("ESPEAKER"))
{
|