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);
|
debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, timeoutMsP, deviceIndexM);
|
||||||
if (timeoutMsP <= 0)
|
if (timeoutMsP <= 0)
|
||||||
return (pTunerM && pTunerM->HasLock());
|
return (pTunerM && pTunerM->HasLock());
|
||||||
else {
|
|
||||||
const int intervalMs = 100;
|
|
||||||
|
|
||||||
for (int t = 0; t < timeoutMsP; t += intervalMs) {
|
cTimeMs timer(timeoutMsP);
|
||||||
if (HasLock(0))
|
|
||||||
return true;
|
while (!timer.TimedOut()) {
|
||||||
cCondWait::SleepMs(intervalMs);
|
if (HasLock(0))
|
||||||
}
|
return true;
|
||||||
return HasLock(0);
|
cCondWait::SleepMs(100);
|
||||||
}
|
}
|
||||||
|
return HasLock(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cSatipDevice::HasInternalCam(void)
|
bool cSatipDevice::HasInternalCam(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user