From f1d70aaa54461082e1d5c8f9743d1dd97ec0ffc8 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Wed, 12 Jan 2022 03:36:27 -0800 Subject: [PATCH] Cog Audio: Add explanatory comment to source code --- Audio/Chain/ConverterNode.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Audio/Chain/ConverterNode.m b/Audio/Chain/ConverterNode.m index 4c6bb5e3f..eddf818c8 100644 --- a/Audio/Chain/ConverterNode.m +++ b/Audio/Chain/ConverterNode.m @@ -400,7 +400,10 @@ static void extrapolate(float *buffer, size_t channels, size_t frameSize, size_t { char writeBuf[CHUNK_SIZE]; - while ([self shouldContinue] == YES) //Need to watch EOS somehow.... + // Removed endOfStream check from here, since we want to be able to flush the converter + // when the end of stream is reached. Convert function instead processes what it can, + // and returns 0 samples when it has nothing more to process at the end of stream. + while ([self shouldContinue] == YES) { int amountConverted = [self convert:writeBuf amount:CHUNK_SIZE]; if (!amountConverted)