From d5bcb0fc1a352c04aa4d8bee72b2a00aafbd8fc0 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Tue, 17 Nov 2015 18:48:07 +0000 Subject: [PATCH] in case we have invalid sizes, clear buffer to avoid a constant tone to be played all the time --- mac/sound.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mac/sound.cpp b/mac/sound.cpp index 75659197..3ebeb34d 100755 --- a/mac/sound.cpp +++ b/mac/sound.cpp @@ -568,10 +568,15 @@ OSStatus CSound::callbackIO ( AudioDeviceID inDevice, pSound->vecsTmpAudioSndCrdStereo[i] = (short) ( pInData[i] * _MAXSHORT ); } - - // call processing callback function - pSound->ProcessCallback ( pSound->vecsTmpAudioSndCrdStereo ); } + else + { + // incompatible sizes, clear work buffer + pSound->vecsTmpAudioSndCrdStereo.Reset ( 0 ); + } + + // call processing callback function + pSound->ProcessCallback ( pSound->vecsTmpAudioSndCrdStereo ); } else {