Further work on end state with long process sizes in R2. This passes tests but is not the minimal necessary change I think - review.

This commit is contained in:
Chris Cannam
2023-06-07 11:16:07 +01:00
parent b1cd0913e2
commit fe1aafea28
3 changed files with 135 additions and 29 deletions

View File

@@ -307,7 +307,10 @@ R2Stretcher::setExpectedInputDuration(size_t samples)
void
R2Stretcher::setMaxProcessSize(size_t samples)
{
m_log.log(2, "R2Stretcher::setMaxProcessSize", samples);
if (samples <= m_maxProcessSize) return;
m_log.log(2, "R2Stretcher::setMaxProcessSize: increasing from, to", m_maxProcessSize, samples);
m_maxProcessSize = samples;
reconfigure();
@@ -1232,6 +1235,8 @@ R2Stretcher::process(const float *const *input, size_t samples, bool final)
{
Profiler profiler("R2Stretcher::process");
m_log.log(2, "process entering, samples and final", samples, final);
if (m_mode == Finished) {
m_log.log(0, "R2Stretcher::process: Cannot process again after final chunk");
return;
@@ -1294,10 +1299,16 @@ R2Stretcher::process(const float *const *input, size_t samples, bool final)
consumed[c],
samples - consumed[c],
final);
if (c == 0) {
m_log.log(2, "consumed channel 0, consumed and samples now", consumed[c], samples);
}
if (consumed[c] < samples) {
allConsumed = false;
} else {
if (final) {
if (c == 0) {
m_log.log(2, "final is true, setting input size", m_channelData[c]->inCount);
}
m_channelData[c]->inputSize = m_channelData[c]->inCount;
}
}