diff --git a/lib/libossaudio/ossaudio.c b/lib/libossaudio/ossaudio.c index cadcc5fb4b96..31d8d0a2a8c1 100644 --- a/lib/libossaudio/ossaudio.c +++ b/lib/libossaudio/ossaudio.c @@ -1,4 +1,4 @@ -/* $NetBSD: ossaudio.c,v 1.12 2000/08/16 16:14:33 tron Exp $ */ +/* $NetBSD: ossaudio.c,v 1.13 2001/05/09 21:49:58 augustss Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -339,8 +339,9 @@ audio_ioctl(int fd, unsigned long com, void *argp) return retval; setblocksize(fd, &tmpinfo); bufinfo.fragsize = tmpinfo.blocksize; - bufinfo.fragments = /* XXX */ - bufinfo.fragstotal = tmpinfo.play.buffer_size / bufinfo.fragsize; + bufinfo.fragments = tmpinfo.hiwat - tmpinfo.play.seek / + bufinfo.fragsize; + bufinfo.fragstotal = tmpinfo.hiwat; bufinfo.bytes = tmpinfo.play.buffer_size; *(struct audio_buf_info *)argp = bufinfo; break; diff --git a/lib/libossaudio/soundcard.h b/lib/libossaudio/soundcard.h index 6f747c95533d..9841f82b8518 100644 --- a/lib/libossaudio/soundcard.h +++ b/lib/libossaudio/soundcard.h @@ -1,4 +1,4 @@ -/* $NetBSD: soundcard.h,v 1.10 1999/11/16 23:56:42 augustss Exp $ */ +/* $NetBSD: soundcard.h,v 1.11 2001/05/09 21:49:58 augustss Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -46,7 +46,7 @@ #ifndef _SOUNDCARD_H_ #define _SOUNDCARD_H_ -#define SOUND_VERSION 0x030000 +#define SOUND_VERSION 0x030001 #define SNDCTL_DSP_RESET _IO ('P', 0) #define SNDCTL_DSP_SYNC _IO ('P', 1) diff --git a/sys/compat/ossaudio/ossaudio.c b/sys/compat/ossaudio/ossaudio.c index 22089478446b..c5cbfe088ead 100644 --- a/sys/compat/ossaudio/ossaudio.c +++ b/sys/compat/ossaudio/ossaudio.c @@ -1,4 +1,4 @@ -/* $NetBSD: ossaudio.c,v 1.33 2001/01/18 20:28:28 jdolecek Exp $ */ +/* $NetBSD: ossaudio.c,v 1.34 2001/05/09 21:50:50 augustss Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -403,8 +403,9 @@ oss_ioctl_audio(p, uap, retval) goto out; setblocksize(fp, &tmpinfo, p); bufinfo.fragsize = tmpinfo.blocksize; - bufinfo.fragments = /* XXX */ - bufinfo.fragstotal = tmpinfo.play.buffer_size / bufinfo.fragsize; + bufinfo.fragments = tmpinfo.hiwat - tmpinfo.play.seek / + bufinfo.fragsize; + bufinfo.fragstotal = tmpinfo.hiwat; bufinfo.bytes = tmpinfo.play.buffer_size; DPRINTF(("oss_sys_ioctl: SNDCTL_DSP_GETxSPACE = %d %d %d %d\n", bufinfo.fragsize, bufinfo.fragments,