1
0
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:
Winfried Koehler 2021-03-02 20:50:43 +01:00 committed by GitHub
parent 55362a2db6
commit ba0b04ba12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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());
}