From 7ae770a79eb394a3715d5cf45134e06ff08ba09a Mon Sep 17 00:00:00 2001 From: Tony Corbett G0WFV Date: Fri, 23 Sep 2016 14:48:44 +0100 Subject: [PATCH] Attempt to recover from ring buffer overflows (#141) --- RingBuffer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RingBuffer.h b/RingBuffer.h index f7000432d..707de1ccb 100644 --- a/RingBuffer.h +++ b/RingBuffer.h @@ -50,7 +50,8 @@ template class CRingBuffer { bool addData(const T* buffer, unsigned int nSamples) { if (nSamples >= freeSpace()) { - LogError("**** Overflow in %s ring buffer, %u >= %u", m_name, nSamples, freeSpace()); + LogError("%s buffer overflow, clearing the buffer. (%u >= %u)", m_name, nSamples, freeSpace()); + clear(); return false; }