aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMax Horn2003-07-25 01:05:08 +0000
committerMax Horn2003-07-25 01:05:08 +0000
commit95bb74e2b886c22adce2fd0bdd40083b8d8efb53 (patch)
tree30e7b545d7cc5fa3370bdcf3f824e3c98e5204a9 /sound
parentb15277e5edcb63b1adf8b6b27060ae15c65aff20 (diff)
downloadscummvm-rg350-95bb74e2b886c22adce2fd0bdd40083b8d8efb53.tar.gz
scummvm-rg350-95bb74e2b886c22adce2fd0bdd40083b8d8efb53.tar.bz2
scummvm-rg350-95bb74e2b886c22adce2fd0bdd40083b8d8efb53.zip
round to nearest
svn-id: r9183
Diffstat (limited to 'sound')
-rw-r--r--sound/rate.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/rate.cpp b/sound/rate.cpp
index 4c026adb83..c056b85a9a 100644
--- a/sound/rate.cpp
+++ b/sound/rate.cpp
@@ -118,7 +118,7 @@ int st_rate_flow(eff_t effp, AudioInputStream &input, st_sample_t *obuf, st_size
icur = input.peek();
/* interpolate */
- out = ilast + (((icur - ilast) * rate->opos_frac) >> FRAC_BITS);
+ out = ilast + (((icur - ilast) * rate->opos_frac + (1UL << (FRAC_BITS-1))) >> FRAC_BITS);
/* output sample & increment position */
out = out * vol / 256;