mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 11:37:42 +00:00
HasLock(): add timeout feature (v2)
This commit is contained in:
parent
92c951a2d7
commit
8658837678
17
device.c
17
device.c
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user