diff options
author | cg <cg@FreeBSD.org> | 2000-05-15 02:10:27 +0000 |
---|---|---|
committer | cg <cg@FreeBSD.org> | 2000-05-15 02:10:27 +0000 |
commit | 85a224d8383c06cac609fb99e5729f78a232d286 (patch) | |
tree | 9b8e704cda0da949eab9a5e88f99081e79f44463 | |
parent | 8206be3a83b56526256456da62a793cc9392a5a4 (diff) | |
download | FreeBSD-src-85a224d8383c06cac609fb99e5729f78a232d286.zip FreeBSD-src-85a224d8383c06cac609fb99e5729f78a232d286.tar.gz |
fix a speed bug that nobody noticed
-rw-r--r-- | sys/dev/sound/isa/ess.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/sound/isa/ess.c b/sys/dev/sound/isa/ess.c index 6072764..879c029 100644 --- a/sys/dev/sound/isa/ess.c +++ b/sys/dev/sound/isa/ess.c @@ -495,11 +495,12 @@ ess_calcspeed9(int *spd) /* rate = source / (256 - divisor) */ /* divisor = 256 - (source / rate) */ speed = *spd; - t0 = 256 - (793800 / speed); - s0 = 793800 / (256 - t0); + t0 = 128 - (793800 / speed); + s0 = 793800 / (128 - t0); - t1 = 0x80 | (256 - (768000 / speed)); - s1 = 768000 / (256 - t1); + t1 = 128 - (768000 / speed); + s1 = 768000 / (128 - t1); + t1 |= 0x80; use0 = (ABS(speed - s0) < ABS(speed - s1))? 1 : 0; |