HasLock(): add timeout feature (v2)

This commit is contained in:
wirbel 2021-02-20 11:43:52 +01:00
parent 92c951a2d7
commit 8658837678
1 changed files with 8 additions and 9 deletions

View File

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