aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2007-06-29 23:33:16 +0000
committerMax Horn2007-06-29 23:33:16 +0000
commitb62ef0496c6e4e73848aa8db919e9df5444cb9e1 (patch)
tree68f30151ff48791c6831ef641cd63bfe2ed4216f
parent0723e3e24a906c2935965df2ccd555ef314c58cb (diff)
downloadscummvm-rg350-b62ef0496c6e4e73848aa8db919e9df5444cb9e1.tar.gz
scummvm-rg350-b62ef0496c6e4e73848aa8db919e9df5444cb9e1.tar.bz2
scummvm-rg350-b62ef0496c6e4e73848aa8db919e9df5444cb9e1.zip
Added small explanatory comment
svn-id: r27779
-rw-r--r--sound/rate.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/rate.cpp b/sound/rate.cpp
index 105b5d5d26..5944e64694 100644
--- a/sound/rate.cpp
+++ b/sound/rate.cpp
@@ -196,7 +196,11 @@ LinearRateConverter<stereo, reverseStereo>::LinearRateConverter(st_rate_t inrate
opos = FRAC_ONE;
- /* increment */
+ // Compute the linear interpolation increment.
+ // This will overflow if inrate >= 2^16, and underflow if outrate >= 2^16.
+ // Also, if the quotient of the two rate becomes too small / too big, that
+ // would cause problems, but since we rarely scale from 1 to 65536 Hz or vice
+ // versa, I think we can live with that limiation ;-).
opos_inc = (inrate << FRAC_BITS) / outrate;
ilast0 = ilast1 = 0;