[Liboss-commit] CVS: liboss/lib esddsp.c,1.15,1.16
Brought to you by:
thesin
|
From: Justin <th...@us...> - 2002-11-07 05:36:53
|
Update of /cvsroot/liboss/liboss/lib
In directory usw-pr-cvs1:/tmp/cvs-serv23548/lib
Modified Files:
esddsp.c
Log Message:
might work, will have to try arts tomorrow I think that is all the handles it needs
Index: esddsp.c
===================================================================
RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- esddsp.c 7 Nov 2002 04:40:37 -0000 1.15
+++ esddsp.c 7 Nov 2002 05:36:50 -0000 1.16
@@ -36,6 +36,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
+#include <sys/errno.h>
#include "liboss/soundcard.h"
#include "liboss/audioio.h"
@@ -199,6 +200,11 @@
static int
dspctl (int fd, request_t request, void *argp)
{
+ struct audio_info tmpinfo;
+
+ u_int u;
+ int idat, retval;
+
static esd_format_t fmt = ESD_BITS16 | ESD_STEREO | ESD_STREAM | ESD_PLAY;
static int speed;
@@ -227,6 +233,26 @@
case SNDCTL_DSP_GETBLKSIZE:
*arg = ESD_BUF_SIZE;
+ break;
+
+ case SNDCTL_DSP_SETFRAGMENT:
+ AUDIO_INITINFO(&tmpinfo);
+ idat = *arg;
+ if ((idat & 0xffff) < 4 || (idat & 0xffff) > 17)
+ return EINVAL;
+ tmpinfo.blocksize = 1 << (idat & 0xffff);
+ tmpinfo.hiwat = ((unsigned)idat >> 16) & 0x7fff;
+ if (tmpinfo.hiwat == 0) /* 0 means set to max */
+ tmpinfo.hiwat = 65536;
+ (void) ioctl(fd, AUDIO_SETINFO, &tmpinfo);
+ retval = ioctl(fd, AUDIO_GETINFO, &tmpinfo);
+ if (retval < 0)
+ return retval;
+ u = tmpinfo.blocksize;
+ for(idat = 0; u > 1; idat++, u >>= 1)
+ ;
+ idat |= (tmpinfo.hiwat & 0x7fff) << 16;
+ *arg = idat;
break;
case SNDCTL_DSP_GETFMTS:
|