From f7ce6d02fa3c73ef6f88655504780ee121c20d89 Mon Sep 17 00:00:00 2001 From: narspt Date: Sat, 10 Apr 2021 02:34:49 +0100 Subject: [PATCH] fix dplus sending header packets inconsistently depending on the number of dplus clients connected on the reflector, in some cases (for eg. with 3 or 6 clients connected) only one client could actually get lots of header packets and the other clients get none --- src/cdplusprotocol.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cdplusprotocol.cpp b/src/cdplusprotocol.cpp index 86aa4fb..80243e9 100644 --- a/src/cdplusprotocol.cpp +++ b/src/cdplusprotocol.cpp @@ -315,7 +315,7 @@ void CDplusProtocol::HandleQueue(void) m_Socket.Send(buffer, client->GetIp()); // is it time to insert a DVheader copy ? - if ( (m_StreamsCache[iModId].m_iSeqCounter++ % 21) == 20 ) + if ( (m_StreamsCache[iModId].m_iSeqCounter % 21) == 20 ) { // yes, clone it CDvHeaderPacket packet2(m_StreamsCache[iModId].m_dvHeader); @@ -333,6 +333,10 @@ void CDplusProtocol::HandleQueue(void) g_Reflector.ReleaseClients(); } + if ( packet->IsDvFrame() ) + { + m_StreamsCache[iModId].m_iSeqCounter++; + } // done delete packet;