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". This fixes problems with e.g FreeBSD TV (fxtv), RealPlayer-7.0 Beta 2 (PR pkg/10818) and KDE's "kscd".
This commit is contained in:
parent
1f76e23f2c
commit
29e1f8bd9f
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ossaudio.c,v 1.11 2000/07/04 09:56:14 augustss Exp $ */
|
||||
/* $NetBSD: ossaudio.c,v 1.12 2000/08/16 16:14:33 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);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ossaudio.c,v 1.31 2000/07/04 09:59:31 augustss Exp $ */
|
||||
/* $NetBSD: ossaudio.c,v 1.32 2000/08/16 16:14:33 tron Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
@ -57,8 +57,8 @@ int ossdebug = 0;
|
||||
#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);
|
||||
|
Loading…
Reference in New Issue
Block a user