Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/sys/compat/ossaudio Pull up revision 1.32 (via patch, r...



details:   https://anonhg.NetBSD.org/src/rev/2dbb6766c872
branches:  netbsd-1-4
changeset: 470873:2dbb6766c872
user:      he <he%NetBSD.org@localhost>
date:      Sat Aug 26 18:40:52 2000 +0000

description:
Pull up revision 1.32 (via patch, requested by tron):
  Use accurate rounding in conversion between OSS and NetBSD
  volume values.  Fixes among other things PR#10818.

diffstat:

 sys/compat/ossaudio/ossaudio.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (20 lines):

diff -r 1e634058712c -r 2dbb6766c872 sys/compat/ossaudio/ossaudio.c
--- a/sys/compat/ossaudio/ossaudio.c    Sat Aug 26 18:35:45 2000 +0000
+++ b/sys/compat/ossaudio/ossaudio.c    Sat Aug 26 18:40:52 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ossaudio.c,v 1.26.6.1 1999/04/16 20:26:51 augustss Exp $       */
+/*     $NetBSD: ossaudio.c,v 1.26.6.2 2000/08/26 18:40:52 he Exp $     */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -57,8 +57,8 @@
 #define DPRINTF(x)
 #endif
 
-#define TO_OSSVOL(x) ((x) * 100 / 255)
-#define FROM_OSSVOL(x) ((x) * 255 / 100)
+#define TO_OSSVOL(x)   (((x) * 100 + 127) / 255)
+#define FROM_OSSVOL(x) ((((x) > 100 ? 100 : (x)) * 255 + 50) / 100)
 
 static struct audiodevinfo *getdevinfo __P((struct file *, struct proc *));
 



Home | Main Index | Thread Index | Old Index