From b33f37952ce750bcee5e439252aaf679e8456c56 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 29 Aug 2020 12:46:37 +0200 Subject: [PATCH] DATV decoder: fixed UDP sender dropping packets. Fixes issue #579 --- plugins/channelrx/demoddatv/datvudpstream.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/channelrx/demoddatv/datvudpstream.cpp b/plugins/channelrx/demoddatv/datvudpstream.cpp index 14ecc625b..84c4c98cd 100644 --- a/plugins/channelrx/demoddatv/datvudpstream.cpp +++ b/plugins/channelrx/demoddatv/datvudpstream.cpp @@ -44,9 +44,10 @@ void DATVUDPStream::pushData(const char *chrData, int nbTSBlocks) for (int i = 0; i < nbTSBlocks; i++) { - if (m_tsBlockIndex < m_tsBlocksPerFrame) + std::copy(chrData + i*m_tsBlockSize, chrData + (i+1)*m_tsBlockSize, m_tsBuffer + m_tsBlockIndex*m_tsBlockSize); + + if (m_tsBlockIndex < m_tsBlocksPerFrame - 1) { - std::copy(chrData + i*m_tsBlockSize, chrData + (i+1)*m_tsBlockSize, m_tsBuffer + m_tsBlockIndex*m_tsBlockSize); m_tsBlockIndex++; } else