From e3ac4b22c3344daba32452acb5db42f34cbefd17 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Tue, 5 Nov 2019 16:50:09 -0500 Subject: [PATCH] Erase the entire buffer on reset instead of just what's in 'front' --- Detector.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Detector.cpp b/Detector.cpp index 4974a25..751cdf2 100644 --- a/Detector.cpp +++ b/Detector.cpp @@ -51,8 +51,13 @@ void Detector::clear () dec_data.params.kin = qMin ((msInPeriod * m_frameRate) / 1000, static_cast (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