diff --git a/HISTORY b/HISTORY index bb4cc04..d24bec9 100644 --- a/HISTORY +++ b/HISTORY @@ -174,3 +174,7 @@ VDR Plugin 'satip' Revision History - Added multicast and RTP-over-TCP support. - Added support for activating/deactivating server on-the-fly. - Extended command-line parameters for setting server quirks. + +2017-xx-xx: Version 2.3.1 + +- Updated for vdr-2.3.4 (Thanks to Klaus Schmidinger). diff --git a/device.c b/device.c index 941c2f2..a844473 100644 --- a/device.c +++ b/device.c @@ -17,8 +17,9 @@ static cSatipDevice * SatipDevicesS[SATIP_MAX_DEVICES] = { NULL }; cSatipDevice::cSatipDevice(unsigned int indexP) : deviceIndexM(indexP), - isPacketDeliveredM(false), + bytesDeliveredM(0), isOpenDvrM(false), + checkTsBufferM(false), deviceNameM(*cString::sprintf("%s %d", *DeviceType(), deviceIndexM)), channelM(), createdM(0), @@ -395,7 +396,7 @@ void cSatipDevice::CloseFilter(int handleP) bool cSatipDevice::OpenDvr(void) { debug9("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); - isPacketDeliveredM = false; + bytesDeliveredM = 0; tsBufferM->Clear(); if (pTunerM) pTunerM->Open(); @@ -481,13 +482,17 @@ bool cSatipDevice::IsIdle(void) return !Receiving(); } -uchar *cSatipDevice::GetData(int *availableP) +uchar *cSatipDevice::GetData(int *availableP, bool checkTsBuffer) { debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); if (isOpenDvrM && tsBufferM) { int count = 0; - if (isPacketDeliveredM) - SkipData(TS_SIZE); + if (bytesDeliveredM) { + tsBufferM->Del(bytesDeliveredM); + bytesDeliveredM = 0; + } + if (checkTsBuffer && tsBufferM->Available() < TS_SIZE) + return NULL; uchar *p = tsBufferM->Get(count); if (p && count >= TS_SIZE) { if (*p != TS_SYNC_BYTE) { @@ -501,7 +506,7 @@ uchar *cSatipDevice::GetData(int *availableP) info("Skipped %d bytes to sync on TS packet", count); return NULL; } - isPacketDeliveredM = true; + bytesDeliveredM = TS_SIZE; if (availableP) *availableP = count; // Update pid statistics @@ -515,8 +520,7 @@ uchar *cSatipDevice::GetData(int *availableP) void cSatipDevice::SkipData(int countP) { debug16("%s [device %u]", __PRETTY_FUNCTION__, deviceIndexM); - tsBufferM->Del(countP); - isPacketDeliveredM = false; + bytesDeliveredM = countP; // Update buffer statistics AddBufferStatistic(countP, tsBufferM->Available()); } @@ -530,11 +534,12 @@ bool cSatipDevice::GetTSPacket(uchar *&dataP) if (cCamSlot *cs = CamSlot()) { if (cs->WantsTsData()) { int available; - dataP = GetData(&available); - if (dataP) { - dataP = cs->Decrypt(dataP, available); - SkipData(available); - } + dataP = GetData(&available, checkTsBufferM); + if (!dataP) + available = 0; + dataP = cs->Decrypt(dataP, available); + SkipData(available); + checkTsBufferM = dataP != NULL; return true; } } diff --git a/device.h b/device.h index 983e24d..3d23bd7 100644 --- a/device.h +++ b/device.h @@ -31,8 +31,9 @@ private: eReadyTimeoutMs = 2000 // in milliseconds }; unsigned int deviceIndexM; - bool isPacketDeliveredM; + int bytesDeliveredM; bool isOpenDvrM; + bool checkTsBufferM; cString deviceNameM; cChannel channelM; cRingBufferLinear *tsBufferM; @@ -82,7 +83,7 @@ protected: // for recording private: - uchar *GetData(int *availableP = NULL); + uchar *GetData(int *availableP = NULL, bool checkTsBuffer = false); void SkipData(int countP); protected: diff --git a/po/pl_PL.po b/po/pl_PL.po index fc5fb59..190df52 100644 --- a/po/pl_PL.po +++ b/po/pl_PL.po @@ -7,14 +7,14 @@ msgid "" msgstr "" "Project-Id-Version: vdr-satip 2.3.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-27 23:41+0100\n" +"POT-Creation-Date: 2017-04-17 22:02+0300\n" "PO-Revision-Date: 2017-02-28 14:22+0100\n" +"Last-Translator: Tomasz Maciej Nowak \n" +"Language-Team: Polish \n" "Language: pl_PL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Last-Translator: Tomasz Maciej Nowak \n" -"Language-Team: Polish \n" "X-Generator: Poedit 1.8.11\n" msgid "PAT (0x00)" diff --git a/satip.c b/satip.c index ec2f8ab..b94bc98 100644 --- a/satip.c +++ b/satip.c @@ -19,15 +19,15 @@ #warning "CURL version >= 7.36.0 is recommended" #endif -#if defined(APIVERSNUM) && APIVERSNUM < 20301 -#error "VDR-2.3.1 API version or greater is required!" +#if defined(APIVERSNUM) && APIVERSNUM < 20304 +#error "VDR-2.3.4 API version or greater is required!" #endif #ifndef GITVERSION #define GITVERSION "" #endif - const char VERSION[] = "2.3.0" GITVERSION; + const char VERSION[] = "2.3.1" GITVERSION; static const char DESCRIPTION[] = trNOOP("SAT>IP Devices"); class cPluginSatip : public cPlugin {