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:
parent
49e2dd1fc1
commit
0f370aa36a
6
tuner.c
6
tuner.c
@ -94,6 +94,7 @@ void cSatipTuner::Action(void)
|
||||
|
||||
bool lastIdleStatus = false;
|
||||
cTimeMs idleCheck(eIdleCheckTimeoutMs);
|
||||
cTimeMs tuning(eTuningTimeoutMs);
|
||||
reConnectM.Set(eConnectTimeoutMs);
|
||||
// Do the thread loop
|
||||
while (Running()) {
|
||||
@ -110,6 +111,7 @@ void cSatipTuner::Action(void)
|
||||
case tsSet:
|
||||
debug4("%s: tsSet [device %d]", __PRETTY_FUNCTION__, deviceIdM);
|
||||
if (Connect()) {
|
||||
tuning.Set(eTuningTimeoutMs);
|
||||
RequestState(tsTuned, smInternal);
|
||||
UpdatePids(true);
|
||||
}
|
||||
@ -132,6 +134,10 @@ void cSatipTuner::Action(void)
|
||||
if (hasLockM)
|
||||
RequestState(tsLocked, smInternal);
|
||||
}
|
||||
else if (tuning.TimedOut()) {
|
||||
error("Tuning timeout - retuning [device %d]", deviceIdM);
|
||||
RequestState(tsSet, smInternal);
|
||||
}
|
||||
break;
|
||||
case tsLocked:
|
||||
debug4("%s: tsLocked [device %d]", __PRETTY_FUNCTION__, deviceIdM);
|
||||
|
1
tuner.h
1
tuner.h
@ -84,6 +84,7 @@ private:
|
||||
ePidUpdateIntervalMs = 250, // in milliseconds
|
||||
eConnectTimeoutMs = 5000, // in milliseconds
|
||||
eIdleCheckTimeoutMs = 15000, // in milliseconds
|
||||
eTuningTimeoutMs = 20000, // in milliseconds
|
||||
eMinKeepAliveIntervalMs = 30000 // in milliseconds
|
||||
};
|
||||
enum eTunerState { tsIdle, tsRelease, tsSet, tsTuned, tsLocked };
|
||||
|
Loading…
Reference in New Issue
Block a user