mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 11:37:42 +00:00
HasLock(): add timeout feature (v3)
This commit is contained in:
parent
8658837678
commit
b8391e7ca3
20
device.c
20
device.c
@ -448,17 +448,15 @@ void cSatipDevice::CloseDvr(void)
|
|||||||
bool cSatipDevice::HasLock(int timeoutMsP) const
|
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());
|
cTimeMs timer(timeoutMsP);
|
||||||
|
while (!timer.TimedOut()) {
|
||||||
cTimeMs timer(timeoutMsP);
|
if (pTunerM && pTunerM->HasLock())
|
||||||
|
return true;
|
||||||
while (!timer.TimedOut()) {
|
cCondWait::SleepMs(100);
|
||||||
if (HasLock(0))
|
}
|
||||||
return true;
|
}
|
||||||
cCondWait::SleepMs(100);
|
return (pTunerM && pTunerM->HasLock());
|
||||||
}
|
|
||||||
return HasLock(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cSatipDevice::HasInternalCam(void)
|
bool cSatipDevice::HasInternalCam(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user