Erase the entire buffer on reset instead of just what's in 'front'

This commit is contained in:
Jordan Sherer 2019-11-05 16:50:09 -05:00
parent 7128daf79e
commit e3ac4b22c3

View File

@ -51,8 +51,13 @@ void Detector::clear ()
dec_data.params.kin = qMin ((msInPeriod * m_frameRate) / 1000, static_cast<unsigned> (sizeof (dec_data.d2) / sizeof (dec_data.d2[0])));
m_bufferPos = m_samplesPerFFT;
#if 0
// erase everything after kin.
memset(dec_data.d2 + dec_data.params.kin, 0, sizeof(dec_data.d2) - (sizeof(dec_data.d2[0]) * dec_data.params.kin));
//memset(dec_data.d2 + dec_data.params.kin, 0, sizeof(dec_data.d2) - (sizeof(dec_data.d2[0]) * dec_data.params.kin));
#else
// erase everything
memset(dec_data.d2, 0, sizeof(dec_data.d2) - (sizeof(dec_data.d2[0])));
#endif
qDebug() << "advancing detector buffer from" << prevKin << "to" << dec_data.params.kin << "delta" << dec_data.params.kin - prevKin;
#else