diff --git a/device.c b/device.c index 09055ab..7c59fbb 100644 --- a/device.c +++ b/device.c @@ -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 diff --git a/device.h b/device.h index 0514448..53c7873 100644 --- a/device.h +++ b/device.h @@ -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