1
0
mirror of https://github.com/rofafor/vdr-plugin-satip.git synced 2023-10-10 13:37:42 +02:00

Added a tuning timeout for better recovery.

This commit is contained in:
Rolf Ahrenberg 2015-08-16 01:10:52 +03:00
parent 49e2dd1fc1
commit 0f370aa36a
2 changed files with 7 additions and 0 deletions

View File

@ -94,6 +94,7 @@ void cSatipTuner::Action(void)
bool lastIdleStatus = false; bool lastIdleStatus = false;
cTimeMs idleCheck(eIdleCheckTimeoutMs); cTimeMs idleCheck(eIdleCheckTimeoutMs);
cTimeMs tuning(eTuningTimeoutMs);
reConnectM.Set(eConnectTimeoutMs); reConnectM.Set(eConnectTimeoutMs);
// Do the thread loop // Do the thread loop
while (Running()) { while (Running()) {
@ -110,6 +111,7 @@ void cSatipTuner::Action(void)
case tsSet: case tsSet:
debug4("%s: tsSet [device %d]", __PRETTY_FUNCTION__, deviceIdM); debug4("%s: tsSet [device %d]", __PRETTY_FUNCTION__, deviceIdM);
if (Connect()) { if (Connect()) {
tuning.Set(eTuningTimeoutMs);
RequestState(tsTuned, smInternal); RequestState(tsTuned, smInternal);
UpdatePids(true); UpdatePids(true);
} }
@ -132,6 +134,10 @@ void cSatipTuner::Action(void)
if (hasLockM) if (hasLockM)
RequestState(tsLocked, smInternal); RequestState(tsLocked, smInternal);
} }
else if (tuning.TimedOut()) {
error("Tuning timeout - retuning [device %d]", deviceIdM);
RequestState(tsSet, smInternal);
}
break; break;
case tsLocked: case tsLocked:
debug4("%s: tsLocked [device %d]", __PRETTY_FUNCTION__, deviceIdM); debug4("%s: tsLocked [device %d]", __PRETTY_FUNCTION__, deviceIdM);

View File

@ -84,6 +84,7 @@ private:
ePidUpdateIntervalMs = 250, // in milliseconds ePidUpdateIntervalMs = 250, // in milliseconds
eConnectTimeoutMs = 5000, // in milliseconds eConnectTimeoutMs = 5000, // in milliseconds
eIdleCheckTimeoutMs = 15000, // in milliseconds eIdleCheckTimeoutMs = 15000, // in milliseconds
eTuningTimeoutMs = 20000, // in milliseconds
eMinKeepAliveIntervalMs = 30000 // in milliseconds eMinKeepAliveIntervalMs = 30000 // in milliseconds
}; };
enum eTunerState { tsIdle, tsRelease, tsSet, tsTuned, tsLocked }; enum eTunerState { tsIdle, tsRelease, tsSet, tsTuned, tsLocked };