mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
HasLock(): add timeout feature (#71)
This commit is contained in:
parent
55362a2db6
commit
ba0b04ba12
8
device.c
8
device.c
@ -448,6 +448,14 @@ void cSatipDevice::CloseDvr(void)
|
||||
bool cSatipDevice::HasLock(int timeoutMsP) const
|
||||
{
|
||||
debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, timeoutMsP, deviceIndexM);
|
||||
if (timeoutMsP > 0) {
|
||||
cTimeMs timer(timeoutMsP);
|
||||
while (!timer.TimedOut()) {
|
||||
if (pTunerM && pTunerM->HasLock())
|
||||
return true;
|
||||
cCondWait::SleepMs(100);
|
||||
}
|
||||
}
|
||||
return (pTunerM && pTunerM->HasLock());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user