mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Adapt decryption for vdr-2.3.4 (Thanks to Klaus Schmidinger).
This commit is contained in:
parent
c5da1074f3
commit
c6145e1ed9
4
HISTORY
4
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).
|
||||
|
31
device.c
31
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;
|
||||
}
|
||||
}
|
||||
|
5
device.h
5
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:
|
||||
|
@ -7,14 +7,14 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-satip 2.3.0\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\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 <tomek_n@o2.pl>\n"
|
||||
"Language-Team: Polish <vdr@linuxtv.org>\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 <tomek_n@o2.pl>\n"
|
||||
"Language-Team: Polish <vdr@linuxtv.org>\n"
|
||||
"X-Generator: Poedit 1.8.11\n"
|
||||
|
||||
msgid "PAT (0x00)"
|
||||
|
6
satip.c
6
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user