Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src pullup (approved by releng-1-5)
details: https://anonhg.NetBSD.org/src/rev/fb01024ebf57
branches: netbsd-1-5
changeset: 489126:fb01024ebf57
user: tron <tron%NetBSD.org@localhost>
date: Wed Aug 16 17:07:51 2000 +0000
description:
pullup (approved by releng-1-5)
Use accurate rounding in conversion between OSS and NetBSD volume values.
The optimized integer formula was supplied by Wolfgang Solfrank on
"tech-kern%netbsd.org@localhost". This fixes problems with e.g FreeBSD TV (fxtv),
RealPlayer-7.0 Beta 2 (PR pkg/10818) and KDE's "kscd".
syssrc/sys/compat/ossaudio/ossaudio.c 1.31 -> 1.32
basesrc/lib/libossaudio/ossaudio.c 1.11 -> 1.12
diffstat:
lib/libossaudio/ossaudio.c | 6 +++---
sys/compat/ossaudio/ossaudio.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diffs (40 lines):
diff -r 3a255e761281 -r fb01024ebf57 lib/libossaudio/ossaudio.c
--- a/lib/libossaudio/ossaudio.c Wed Aug 16 14:14:17 2000 +0000
+++ b/lib/libossaudio/ossaudio.c Wed Aug 16 17:07:51 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ossaudio.c,v 1.10.4.1 2000/08/07 00:28:46 augustss Exp $ */
+/* $NetBSD: ossaudio.c,v 1.10.4.2 2000/08/16 17:07:51 tron 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) > 100 ? 100 : (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);
diff -r 3a255e761281 -r fb01024ebf57 sys/compat/ossaudio/ossaudio.c
--- a/sys/compat/ossaudio/ossaudio.c Wed Aug 16 14:14:17 2000 +0000
+++ b/sys/compat/ossaudio/ossaudio.c Wed Aug 16 17:07:51 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ossaudio.c,v 1.30.4.1 2000/08/07 00:28:49 augustss Exp $ */
+/* $NetBSD: ossaudio.c,v 1.30.4.2 2000/08/16 17:07:52 tron 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) > 100 ? 100 : (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 *));
static int opaque_to_enum(struct audiodevinfo *di, audio_mixer_name_t *label, int opq);
Home |
Main Index |
Thread Index |
Old Index