correct sample delay pulls with negative index

This commit is contained in:
Stephen Birarda 2013-12-17 11:47:50 -08:00
parent bbe525412f
commit ff0d31857a

View file

@ -162,7 +162,7 @@ int16_t* AudioRingBuffer::shiftedPositionAccomodatingWrap(int16_t* position, int
return position + numSamplesShift - _sampleCapacity;
} else if (numSamplesShift < 0 && position + numSamplesShift < _buffer) {
// this shift will go around to the end of the ring
return position + numSamplesShift - _sampleCapacity;
return position + numSamplesShift + _sampleCapacity;
} else {
return position + numSamplesShift;
}