From b62ef0496c6e4e73848aa8db919e9df5444cb9e1 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 29 Jun 2007 23:33:16 +0000 Subject: Added small explanatory comment svn-id: r27779 --- sound/rate.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sound') 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::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; -- cgit v1.2.3