From f04761ff42af4710b334bdc0104addb023271cda Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sun, 26 Jun 2022 03:57:19 -0700 Subject: [PATCH] [Audio Output] Fix for previous commit This fixes the problem caused by the following commit: 050aaaf85239f3810924a54482ed1c5e1f5b83e4 Signed-off-by: Christopher Snowhill --- Audio/Output/OutputAVFoundation.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Audio/Output/OutputAVFoundation.m b/Audio/Output/OutputAVFoundation.m index e4d157228..412b696c9 100644 --- a/Audio/Output/OutputAVFoundation.m +++ b/Audio/Output/OutputAVFoundation.m @@ -180,16 +180,17 @@ static OSStatus eqRenderCallback(void *inRefCon, AudioUnitRenderActionFlags *ioA int samplesProcessed; size_t totalDone = 0; size_t inDone = 0; + size_t visFrameCount = frameCount; { [currentPtsLock lock]; - samplesProcessed = (int)r8bstate_resample(r8bvis, &visAudio[totalDone], frameCount, &inDone, &visTemp[0], 8192); + samplesProcessed = (int)r8bstate_resample(r8bvis, &visAudio[totalDone], visFrameCount, &inDone, &visTemp[0], 8192); [currentPtsLock unlock]; if(samplesProcessed) { [visController postVisPCM:&visTemp[0] amount:samplesProcessed]; } totalDone += inDone; - frameCount -= inDone; - } while(samplesProcessed && frameCount); + visFrameCount -= inDone; + } while(samplesProcessed && visFrameCount); } } else if(r8bvis) { for(;;) {