Cog Audio: Fix converter so that seeking on startup playback position resume works properly

This commit is contained in:
Christopher Snowhill 2022-01-12 02:55:11 -08:00
parent 16402f9982
commit 84d445cffe

View file

@ -403,7 +403,15 @@ static void extrapolate(float *buffer, size_t channels, size_t frameSize, size_t
while ([self shouldContinue] == YES) //Need to watch EOS somehow.... while ([self shouldContinue] == YES) //Need to watch EOS somehow....
{ {
int amountConverted = [self convert:writeBuf amount:CHUNK_SIZE]; int amountConverted = [self convert:writeBuf amount:CHUNK_SIZE];
if (!amountConverted) break; if (!amountConverted)
{
if (emittingSilence)
{
memset(writeBuf, 0, sizeof(writeBuf));
amountConverted = CHUNK_SIZE;
}
else break;
}
[self writeData:writeBuf amount:amountConverted]; [self writeData:writeBuf amount:amountConverted];
} }
} }