Source-Changes-HG archive

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

[src/netbsd-1-4]: src/lib/libossaudio Pull up revision 1.12 (via patch, reque...



details:   https://anonhg.NetBSD.org/src/rev/11b155906035
branches:  netbsd-1-4
changeset: 470874:11b155906035
user:      he <he%NetBSD.org@localhost>
date:      Sat Aug 26 18:41:36 2000 +0000

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

diffstat:

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

diffs (20 lines):

diff -r 2dbb6766c872 -r 11b155906035 lib/libossaudio/ossaudio.c
--- a/lib/libossaudio/ossaudio.c        Sat Aug 26 18:40:52 2000 +0000
+++ b/lib/libossaudio/ossaudio.c        Sat Aug 26 18:41:36 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ossaudio.c,v 1.6.2.1 1999/04/16 20:26:49 augustss Exp $        */
+/*     $NetBSD: ossaudio.c,v 1.6.2.2 2000/08/26 18:41:36 he Exp $      */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -54,8 +54,8 @@
 
 #define GET_DEV(com) ((com) & 0xff)
 
-#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(int);
 



Home | Main Index | Thread Index | Old Index