1
0
mirror of https://github.com/rofafor/vdr-plugin-satip.git synced 2023-10-10 13:37:42 +02:00

Optimized the startup delay.

This commit is contained in:
Rolf Ahrenberg 2014-03-28 19:53:22 +02:00
parent b5ec84fd91
commit 9a6ae40954
2 changed files with 8 additions and 2 deletions

View File

@ -19,7 +19,9 @@ cSatipDevice::cSatipDevice(unsigned int indexP)
isPacketDeliveredM(false),
isOpenDvrM(false),
deviceNameM(*cString::sprintf("%s %d", *DeviceType(), deviceIndexM)),
channelM()
channelM(),
createdM(0),
mutexM()
{
unsigned int bufsize = (unsigned int)SATIP_BUFFER_SIZE;
bufsize -= (bufsize % TS_SIZE);
@ -147,7 +149,7 @@ cString cSatipDevice::GetInformation(unsigned int pageP)
bool cSatipDevice::Ready(void)
{
//debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM);
return (cSatipDiscover::GetInstance()->GetServerCount() > 0);
return ((cSatipDiscover::GetInstance()->GetServerCount() > 0) || (createdM.Elapsed() > eReadyTimeoutMs));
}
cString cSatipDevice::DeviceType(void) const

View File

@ -26,6 +26,9 @@ public:
// private parts
private:
enum {
eReadyTimeoutMs = 2000 // in milliseconds
};
unsigned int deviceIndexM;
bool isPacketDeliveredM;
bool isOpenDvrM;
@ -34,6 +37,7 @@ private:
cRingBufferLinear *tsBufferM;
cSatipTuner *pTunerM;
cSatipSectionFilterHandler *pSectionFilterHandlerM;
cTimeMs createdM;
cMutex mutexM;
// constructor & destructor