Merge pull request #618 from dwuertz/fix-region-end

Respect region end opcode
This commit is contained in:
JP Cimalando 2021-02-02 18:18:09 +01:00 committed by GitHub
commit fec97ffc16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -950,9 +950,11 @@ void Voice::Impl::fillWithData(AudioSpan<float> buffer) noexcept
else { else {
// cut short the voice at the instant of reaching end of sample // cut short the voice at the instant of reaching end of sample
const auto sampleEnd = min( const auto sampleEnd = min(
static_cast<int>(currentPromise_->information.end), int(region_->trueSampleEnd(resources_.filePool.getOversamplingFactor())),
static_cast<int>(source.getNumFrames()) int(currentPromise_->information.end),
) - 1; int(source.getNumFrames()))
- 1;
for (unsigned i = 0; i < numSamples; ++i) { for (unsigned i = 0; i < numSamples; ++i) {
if ((*indices)[i] >= sampleEnd) { if ((*indices)[i] >= sampleEnd) {
#ifndef NDEBUG #ifndef NDEBUG