Add logic to read in any data that may have come in during processing.
parent
a2066cb865
commit
11ce99bb6a
|
@ -247,16 +247,20 @@ std::shared_ptr<short> ParallelStep::execute(std::shared_ptr<short> inputSamples
|
||||||
|
|
||||||
void ParallelStep::executeRunnerThread_(ThreadInfo* threadState)
|
void ParallelStep::executeRunnerThread_(ThreadInfo* threadState)
|
||||||
{
|
{
|
||||||
int samplesIn = codec2_fifo_used(threadState->inputFifo);
|
int samplesIn = 0;
|
||||||
int samplesOut = 0;
|
do
|
||||||
if (codec2_fifo_read(threadState->inputFifo, threadState->tempInput.get(), samplesIn) != 0)
|
|
||||||
{
|
{
|
||||||
samplesIn = 0;
|
samplesIn = codec2_fifo_used(threadState->inputFifo);
|
||||||
}
|
int samplesOut = 0;
|
||||||
|
if (codec2_fifo_read(threadState->inputFifo, threadState->tempInput.get(), samplesIn) != 0)
|
||||||
|
{
|
||||||
|
samplesIn = 0;
|
||||||
|
}
|
||||||
|
|
||||||
auto output = threadState->step->execute(threadState->tempInput, samplesIn, &samplesOut);
|
auto output = threadState->step->execute(threadState->tempInput, samplesIn, &samplesOut);
|
||||||
if (samplesOut > 0)
|
if (samplesOut > 0)
|
||||||
{
|
{
|
||||||
codec2_fifo_write(threadState->outputFifo, output.get(), samplesOut);
|
codec2_fifo_write(threadState->outputFifo, output.get(), samplesOut);
|
||||||
}
|
}
|
||||||
|
} while (codec2_fifo_used(threadState->inputFifo) > 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue