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

HasLock(): add timeout feature (v3)

This commit is contained in:
wirbel 2021-03-02 11:05:15 +01:00
parent 8658837678
commit b8391e7ca3

View File

@ -448,17 +448,15 @@ void cSatipDevice::CloseDvr(void)
bool cSatipDevice::HasLock(int timeoutMsP) const bool cSatipDevice::HasLock(int timeoutMsP) const
{ {
debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, timeoutMsP, deviceIndexM); debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, timeoutMsP, deviceIndexM);
if (timeoutMsP <= 0) if (timeoutMsP > 0) {
return (pTunerM && pTunerM->HasLock()); cTimeMs timer(timeoutMsP);
while (!timer.TimedOut()) {
cTimeMs timer(timeoutMsP); if (pTunerM && pTunerM->HasLock())
return true;
while (!timer.TimedOut()) { cCondWait::SleepMs(100);
if (HasLock(0)) }
return true; }
cCondWait::SleepMs(100); return (pTunerM && pTunerM->HasLock());
}
return HasLock(0);
} }
bool cSatipDevice::HasInternalCam(void) bool cSatipDevice::HasInternalCam(void)