From f493df0e3d424647aa98271d56d5c332fa58ed07 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Sun, 30 Mar 2014 14:56:11 +0300 Subject: [PATCH] Changed implementation to report about RTP packet errors on 5 minutes interval only. --- HISTORY | 5 +++++ po/de_DE.po | 6 +++--- po/fi_FI.po | 6 +++--- satip.c | 2 +- socket.c | 9 ++++++++- socket.h | 5 +++++ 6 files changed, 25 insertions(+), 8 deletions(-) diff --git a/HISTORY b/HISTORY index 0ac3863..f9867f4 100644 --- a/HISTORY +++ b/HISTORY @@ -25,3 +25,8 @@ VDR Plugin 'satip' Revision History - Added support for cDevice::Ready(). - Fixed pid leaking while disabling section filters. - Fixed keepalive heartbeat. + +2014-03-30: Version 0.2.1 + +- Changed implementation to report about RTP packet + errors on 5 minutes interval only. diff --git a/po/de_DE.po b/po/de_DE.po index e6d84d9..5561797 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -5,10 +5,10 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-satip 0.2.0\n" +"Project-Id-Version: vdr-satip 0.2.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-28 03:28+0200\n" -"PO-Revision-Date: 2014-03-28 03:28+0200\n" +"POT-Creation-Date: 2014-03-30 03:30+0200\n" +"PO-Revision-Date: 2014-03-30 03:30+0200\n" "Last-Translator: Frank Neumann \n" "Language-Team: German \n" "Language: de\n" diff --git a/po/fi_FI.po b/po/fi_FI.po index d8e6766..0e170c2 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -5,10 +5,10 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-satip 0.2.0\n" +"Project-Id-Version: vdr-satip 0.2.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-28 03:28+0200\n" -"PO-Revision-Date: 2014-03-28 03:28+0200\n" +"POT-Creation-Date: 2014-03-30 03:30+0200\n" +"PO-Revision-Date: 2014-03-30 03:30+0200\n" "Last-Translator: Rolf Ahrenberg\n" "Language-Team: Finnish \n" "Language: fi\n" diff --git a/satip.c b/satip.c index 894b30f..1764293 100644 --- a/satip.c +++ b/satip.c @@ -21,7 +21,7 @@ #define GITVERSION "" #endif - const char VERSION[] = "0.2.0" GITVERSION; + const char VERSION[] = "0.2.1" GITVERSION; static const char DESCRIPTION[] = trNOOP("SAT>IP Devices"); class cPluginSatip : public cPlugin { diff --git a/socket.c b/socket.c index d3f5e35..6199cac 100644 --- a/socket.c +++ b/socket.c @@ -21,6 +21,8 @@ cSatipSocket::cSatipSocket() : socketPortM(0), socketDescM(-1), + lastErrorReportM(0), + packetErrorsM(0), sequenceNumberM(-1) { debug("cSatipSocket::%s()", __FUNCTION__); @@ -157,7 +159,12 @@ int cSatipSocket::ReadVideo(unsigned char *bufferAddrP, unsigned int bufferLenP) if ((((sequenceNumberM + 1) % 0xFFFF) == 0) && (seq == 0xFFFF)) sequenceNumberM = -1; else if ((sequenceNumberM >= 0) && (((sequenceNumberM + 1) % 0xFFFF) != seq)) { - error("missed %d RTP packets", seq - sequenceNumberM - 1); + packetErrorsM++; + if (time(NULL) - lastErrorReportM > eReportIntervalS) { + info("detected %d RTP packet errors", packetErrorsM); + packetErrorsM = 0; + lastErrorReportM = time(NULL); + } sequenceNumberM = seq; } else diff --git a/socket.h b/socket.h index 41b1ecd..8b97bde 100644 --- a/socket.h +++ b/socket.h @@ -12,9 +12,14 @@ class cSatipSocket { private: + enum { + eReportIntervalS = 300 // in seconds + }; int socketPortM; int socketDescM; struct sockaddr_in sockAddrM; + time_t lastErrorReportM; + int packetErrorsM; int sequenceNumberM; public: