Skip to content

Commit

Permalink
Fix loading small IR files
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Jul 10, 2023
1 parent 4aa2f86 commit 47dad77
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion modules/FFTConvolver
16 changes: 10 additions & 6 deletions src/TwoStageThreadedConvolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,21 @@ class TwoStageThreadedConvolver : public fftconvolver::TwoStageFFTConvolver,

bool init(const fftconvolver::Sample* const ir, const size_t irLen)
{
if (irLen > kTailBlockSize * 2)
if (fftconvolver::TwoStageFFTConvolver::init(kHeadBlockSize, kTailBlockSize, ir, irLen))
{
if (! fftconvolver::TwoStageFFTConvolver::init(kHeadBlockSize, kTailBlockSize, ir, irLen))
return false;

startThread(true);
return true;
}

nonThreadedConvolver = new fftconvolver::FFTConvolver();
return nonThreadedConvolver->init(kHeadBlockSize, ir, irLen);
ScopedPointer<fftconvolver::FFTConvolver> conv(new fftconvolver::FFTConvolver);

if (conv->init(kHeadBlockSize, ir, irLen))
{
nonThreadedConvolver = conv.release();
return true;
}

return false;
}

void process(const fftconvolver::Sample* const input, fftconvolver::Sample* const output, const size_t len)
Expand Down

0 comments on commit 47dad77

Please sign in to comment.