Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion dsp/ResamplingContainer/ResamplingContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,14 @@ class ResamplingContainer
const auto populated2 = mResampler2->PopBlock(outputs, nFrames);
if (populated2 < nFrames)
{
throw std::runtime_error("Did not yield enough samples to provide the required output buffer!");
std::cerr << "Did not yield enough samples (" << populated2 << ") to provide the required output buffer (expected"
<< nFrames << ")! Filling with last sample..." << std::endl;
for (int c = 0; c < NCHANS; c++) {
const T lastSample = populated2 > 0 ? outputs[c][populated2 - 1] : 0.0;
for (int i = populated2; i < nFrames; i++) {
outputs[c][i] = lastSample;
}
}
}
// Get ready for the next block:
mResampler1->RenormalizePhases();
Expand Down