From ada236a63b0b6dc5f2490526ff70b4278ba82f6b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 2 Aug 2003 19:17:54 +0000 Subject: one addition less svn-id: r9425 --- sound/rate.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/rate.cpp b/sound/rate.cpp index 5498f48202..89a6f4a15e 100644 --- a/sound/rate.cpp +++ b/sound/rate.cpp @@ -89,7 +89,7 @@ LinearRateConverter::LinearRateConverter(st_rate_t inrate } opos_frac = 0; - opos = 0; + opos = 1; /* increment */ incr = (inrate << FRAC_BITS) / outrate; @@ -119,7 +119,7 @@ int LinearRateConverter::flow(AudioInputStream &input, st while (obuf < oend) { // read enough input samples so that ipos > opos - while (ipos <= opos + 1) { + while (ipos <= opos) { // Abort if we reached the end of the input buffer if (input.eof()) @@ -136,7 +136,7 @@ int LinearRateConverter::flow(AudioInputStream &input, st // Loop as long as the outpos trails behind, and as long as there is // still space in the output buffer. - while (ipos > opos + 1) { + while (ipos > opos) { // interpolate tmpOut = (st_sample_t)(ilast[0] + (((icur[0] - ilast[0]) * opos_frac + (1UL << (FRAC_BITS-1))) >> FRAC_BITS)); -- cgit v1.2.3