With longer process sizes we can end up with insufficient space in the inbuf, but enough in the outbuf following the previous retrieve call for a consume to be possible before writing to the inbuf
This commit is contained in:
@@ -673,6 +673,7 @@ int main(int argc, char **argv)
|
|||||||
RubberBandStretcher ts(sfinfo.samplerate, channels, options,
|
RubberBandStretcher ts(sfinfo.samplerate, channels, options,
|
||||||
ratio, frequencyshift);
|
ratio, frequencyshift);
|
||||||
ts.setExpectedInputDuration(sfinfo.frames);
|
ts.setExpectedInputDuration(sfinfo.frames);
|
||||||
|
ts.setMaxProcessSize(bs);
|
||||||
|
|
||||||
int frame = 0;
|
int frame = 0;
|
||||||
int percent = 0;
|
int percent = 0;
|
||||||
|
|||||||
@@ -647,6 +647,11 @@ R3Stretcher::process(const float *const *input, size_t samples, bool final)
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t ws = m_channelData[0]->inbuf->getWriteSpace();
|
size_t ws = m_channelData[0]->inbuf->getWriteSpace();
|
||||||
|
if (samples > ws) {
|
||||||
|
m_log.log(2, "R3Stretcher::process: insufficient space in input buffer, attempting consume before write");
|
||||||
|
consume();
|
||||||
|
ws = m_channelData[0]->inbuf->getWriteSpace();
|
||||||
|
}
|
||||||
if (samples > ws) {
|
if (samples > ws) {
|
||||||
m_log.log(0, "R3Stretcher::process: WARNING: Forced to increase input buffer size. Either setMaxProcessSize was not properly called or process is being called repeatedly without retrieve. Write space and samples", ws, samples);
|
m_log.log(0, "R3Stretcher::process: WARNING: Forced to increase input buffer size. Either setMaxProcessSize was not properly called or process is being called repeatedly without retrieve. Write space and samples", ws, samples);
|
||||||
size_t newSize = m_channelData[0]->inbuf->getSize() - ws + samples;
|
size_t newSize = m_channelData[0]->inbuf->getSize() - ws + samples;
|
||||||
|
|||||||
Reference in New Issue
Block a user