From 3b14fdfeff059d1614d496d3e8f2f1cef638ba5a Mon Sep 17 00:00:00 2001 From: Klaas de Waal Date: Fri, 20 Dec 2024 18:07:04 +0100 Subject: [PATCH] Update pespacket CC also when out of sync Update the copy of the continuity counter value of the last received pes packet also when the packet is out of sync; it is still the last packet received. --- mythtv/libs/libmythtv/mpeg/pespacket.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mythtv/libs/libmythtv/mpeg/pespacket.cpp b/mythtv/libs/libmythtv/mpeg/pespacket.cpp index 6491e107433..f3b6a18bc9d 100644 --- a/mythtv/libs/libmythtv/mpeg/pespacket.cpp +++ b/mythtv/libs/libmythtv/mpeg/pespacket.cpp @@ -87,10 +87,21 @@ bool PESPacket::AddTSPacket(const TSPacket* packet, int cardid, bool &broken) } else if (int(m_ccLast) == cc) { - // do nothing with repeats + // Do nothing with repeats + if (VERBOSE_LEVEL_CHECK(VB_RECORD, LOG_DEBUG)) + { + LOG(VB_RECORD, LOG_ERR, + QString("AddTSPacket[%1]: Repeat packet!! ").arg(cardid) + + QString("PID: 0x%1, continuity counter: %2 ").arg(packet->PID(),0,16).arg(cc) + + QString("(expected %1)").arg(ccExp)); + } + return true; } else { + // Even if the packet is out of sync it is still the last packet received + m_ccLast = cc; + LOG(VB_RECORD, LOG_ERR, QString("AddTSPacket[%1]: Out of sync!!! Need to wait for next payloadStart ").arg(cardid) + QString("PID: 0x%1, continuity counter: %2 ").arg(packet->PID(),0,16).arg(cc) +