mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 11:37:42 +00:00
HasLock(): add timeout feature
This commit is contained in:
parent
43b60b1566
commit
92c951a2d7
13
device.c
13
device.c
@ -448,7 +448,18 @@ void cSatipDevice::CloseDvr(void)
|
||||
bool cSatipDevice::HasLock(int timeoutMsP) const
|
||||
{
|
||||
debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, timeoutMsP, deviceIndexM);
|
||||
return (pTunerM && pTunerM->HasLock());
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
bool cSatipDevice::HasInternalCam(void)
|
||||
|
Loading…
x
Reference in New Issue
Block a user