mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Added a double check for the idle release.
This commit is contained in:
parent
6384b8694e
commit
4e2535a7e2
16
tuner.c
16
tuner.c
@ -29,7 +29,6 @@ cSatipTuner::cSatipTuner(cSatipDeviceIf &deviceP, unsigned int packetLenP)
|
||||
nextServerM(NULL, deviceP.GetId(), 0),
|
||||
mutexM(),
|
||||
reConnectM(),
|
||||
idleReleaseM(),
|
||||
keepAliveM(),
|
||||
statusUpdateM(),
|
||||
pidUpdateCacheM(),
|
||||
@ -92,8 +91,10 @@ cSatipTuner::~cSatipTuner()
|
||||
void cSatipTuner::Action(void)
|
||||
{
|
||||
debug1("%s Entering [device %d]", __PRETTY_FUNCTION__, deviceIdM);
|
||||
|
||||
bool lastIdleStatus = false;
|
||||
cTimeMs idleCheck(eIdleCheckTimeoutMs);
|
||||
reConnectM.Set(eConnectTimeoutMs);
|
||||
idleReleaseM.Set(eIdleTimeoutMs);
|
||||
// Do the thread loop
|
||||
while (Running()) {
|
||||
UpdateCurrentState();
|
||||
@ -118,7 +119,8 @@ void cSatipTuner::Action(void)
|
||||
case tsTuned:
|
||||
debug4("%s: tsTuned [device %d]", __PRETTY_FUNCTION__, deviceIdM);
|
||||
reConnectM.Set(eConnectTimeoutMs);
|
||||
idleReleaseM.Set(eIdleTimeoutMs);
|
||||
idleCheck.Set(eIdleCheckTimeoutMs);
|
||||
lastIdleStatus = false;
|
||||
// Read reception statistics via DESCRIBE and RTCP
|
||||
if (hasLockM || ReadReceptionStatus()) {
|
||||
// Quirk for devices without valid reception data
|
||||
@ -148,12 +150,14 @@ void cSatipTuner::Action(void)
|
||||
RequestState(tsSet, smInternal);
|
||||
break;
|
||||
}
|
||||
if (idleReleaseM.TimedOut()) {
|
||||
idleReleaseM.Set(eIdleTimeoutMs);
|
||||
if (deviceM->IsIdle()) {
|
||||
if (idleCheck.TimedOut()) {
|
||||
bool currentIdleStatus = deviceM->IsIdle();
|
||||
if (lastIdleStatus && currentIdleStatus) {
|
||||
info("Idle timeout - releasing [device %d]", deviceIdM);
|
||||
RequestState(tsRelease, smInternal);
|
||||
}
|
||||
lastIdleStatus = currentIdleStatus;
|
||||
idleCheck.Set(eIdleCheckTimeoutMs);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
3
tuner.h
3
tuner.h
@ -83,7 +83,7 @@ private:
|
||||
eStatusUpdateTimeoutMs = 1000, // in milliseconds
|
||||
ePidUpdateIntervalMs = 250, // in milliseconds
|
||||
eConnectTimeoutMs = 5000, // in milliseconds
|
||||
eIdleTimeoutMs = 30000, // in milliseconds
|
||||
eIdleCheckTimeoutMs = 15000, // in milliseconds
|
||||
eMinKeepAliveIntervalMs = 30000 // in milliseconds
|
||||
};
|
||||
enum eTunerState { tsIdle, tsRelease, tsSet, tsTuned, tsLocked };
|
||||
@ -101,7 +101,6 @@ private:
|
||||
cSatipTunerServer nextServerM;
|
||||
cMutex mutexM;
|
||||
cTimeMs reConnectM;
|
||||
cTimeMs idleReleaseM;
|
||||
cTimeMs keepAliveM;
|
||||
cTimeMs statusUpdateM;
|
||||
cTimeMs pidUpdateCacheM;
|
||||
|
Loading…
Reference in New Issue
Block a user