From 11c7131875594b38097f3f19d6d34ede9a58d72c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 3 Jan 2019 18:49:18 -0800 Subject: [PATCH] Replace forgotten clamp to frameCountMax removed by e75dce254364cda52e482058393b52f3e66ee204 --- app/streaming/audio/renderers/soundioaudiorenderer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/streaming/audio/renderers/soundioaudiorenderer.cpp b/app/streaming/audio/renderers/soundioaudiorenderer.cpp index a340f476..dd88c5f3 100644 --- a/app/streaming/audio/renderers/soundioaudiorenderer.cpp +++ b/app/streaming/audio/renderers/soundioaudiorenderer.cpp @@ -369,6 +369,9 @@ void SoundIoAudioRenderer::sioWriteCallback(SoundIoOutStream* stream, int frameC (me->m_OpusChannelCount * stream->bytes_per_sample); int bytesRead = 0; + // Clamp framesLeft to frameCountMax + framesLeft = qMin(framesLeft, frameCountMax); + // Ensure we always write at least a buffer, even if it's silence, to avoid // busy looping when no audio data is available while libsoundio tries to keep // us from starving the output device.