HasLock(): add timeout feature (v3)

This commit is contained in:
wirbel 2021-03-02 11:05:15 +01:00
parent 8658837678
commit b8391e7ca3
1 changed files with 9 additions and 11 deletions

View File

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