diff --git a/lib/libossaudio/ossaudio.c b/lib/libossaudio/ossaudio.c index 478eb74a609d..b3a433f1a310 100644 --- a/lib/libossaudio/ossaudio.c +++ b/lib/libossaudio/ossaudio.c @@ -1,4 +1,4 @@ -/* $NetBSD: ossaudio.c,v 1.21 2007/06/11 13:05:46 joerg Exp $ */ +/* $NetBSD: ossaudio.c,v 1.22 2007/09/18 22:57:31 mlelstv Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__RCSID("$NetBSD: ossaudio.c,v 1.21 2007/06/11 13:05:46 joerg Exp $"); +__RCSID("$NetBSD: ossaudio.c,v 1.22 2007/09/18 22:57:31 mlelstv Exp $"); /* * This is an OSS (Linux) sound API emulator. @@ -434,10 +434,21 @@ audio_ioctl(int fd, unsigned long com, void *argp) if (retval < 0) return retval; break; + case SNDCTL_DSP_GETODELAY: + retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo); + if (retval < 0) + return retval; + idat = tmpinfo.play.seek + tmpinfo.blocksize / 2; + INTARG = idat; + break; + case SNDCTL_DSP_PROFILE: + /* This gives just a hint to the driver, + * implementing it as a NOP is ok + */ + break; case SNDCTL_DSP_MAPINBUF: case SNDCTL_DSP_MAPOUTBUF: case SNDCTL_DSP_SETSYNCRO: - case SNDCTL_DSP_PROFILE: errno = EINVAL; return -1; /* XXX unimplemented */ default: diff --git a/lib/libossaudio/soundcard.h b/lib/libossaudio/soundcard.h index 7b8ce6a6b7aa..e2916deb8587 100644 --- a/lib/libossaudio/soundcard.h +++ b/lib/libossaudio/soundcard.h @@ -1,4 +1,4 @@ -/* $NetBSD: soundcard.h,v 1.15 2005/02/09 18:02:53 drochner Exp $ */ +/* $NetBSD: soundcard.h,v 1.16 2007/09/18 22:57:31 mlelstv Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -99,6 +99,7 @@ #define SNDCTL_DSP_SETSYNCRO _IO ('P', 21) #define SNDCTL_DSP_SETDUPLEX _IO ('P', 22) #define SNDCTL_DSP_PROFILE _IOW ('P', 23, int) +#define SNDCTL_DSP_GETODELAY _IOR ('P', 23, int) #define APF_NORMAL 0 #define APF_NETWORK 1 #define APF_CPUINTENS 2