in case we have invalid sizes, clear buffer to avoid a constant tone to be played all the time

This commit is contained in:
Volker Fischer 2015-11-17 18:48:07 +00:00
parent 0ac2421e61
commit d5bcb0fc1a

View file

@ -568,11 +568,16 @@ OSStatus CSound::callbackIO ( AudioDeviceID inDevice,
pSound->vecsTmpAudioSndCrdStereo[i] = pSound->vecsTmpAudioSndCrdStereo[i] =
(short) ( pInData[i] * _MAXSHORT ); (short) ( pInData[i] * _MAXSHORT );
} }
}
else
{
// incompatible sizes, clear work buffer
pSound->vecsTmpAudioSndCrdStereo.Reset ( 0 );
}
// call processing callback function // call processing callback function
pSound->ProcessCallback ( pSound->vecsTmpAudioSndCrdStereo ); pSound->ProcessCallback ( pSound->vecsTmpAudioSndCrdStereo );
} }
}
else else
{ {
// check size (float32 has four bytes) // check size (float32 has four bytes)