From 443c363b1c3787e7d8e3a5c9ad649263aadf95eb Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Tue, 9 Aug 2016 17:20:26 +0100 Subject: [PATCH] Reset lastFrameValid when used up. --- DMRSlot.cpp | 4 +++- DStarControl.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/DMRSlot.cpp b/DMRSlot.cpp index 3bbf6b3..daa1665 100644 --- a/DMRSlot.cpp +++ b/DMRSlot.cpp @@ -1562,8 +1562,10 @@ void CDMRSlot::insertSilence(unsigned int count) for (unsigned int i = 0U; i < count; i++) { // Only use our silence frame if its AMBE audio data if (fid == FID_ETSI || fid == FID_DMRA) { - if (i > 0U) + if (i > 0U) { ::memcpy(data, DMR_SILENCE_DATA, DMR_FRAME_LENGTH_BYTES + 2U); + m_lastFrameValid = false; + } } if (n == 0U) { diff --git a/DStarControl.cpp b/DStarControl.cpp index b3ae27d..75dcf93 100644 --- a/DStarControl.cpp +++ b/DStarControl.cpp @@ -848,6 +848,8 @@ void CDStarControl::insertSilence(unsigned int count) writeQueueDataNet(m_lastFrame); } } else { + m_lastFrameValid = false; + if (n == 0U) writeQueueDataNet(DSTAR_NULL_FRAME_SYNC_BYTES); else