Fix keepalive interval

This commit is contained in:
Rolf Ahrenberg 2021-05-26 22:10:34 +03:00
parent 1ad0a81d16
commit 417d4ed8fc
2 changed files with 4 additions and 2 deletions

View File

@ -41,7 +41,7 @@ cSatipTuner::cSatipTuner(cSatipDeviceIf &deviceP, unsigned int packetLenP)
currentStateM(tsIdle),
internalStateM(),
externalStateM(),
timeoutM(eMinKeepAliveIntervalMs),
timeoutM(eMinKeepAliveIntervalMs - eKeepAlivePreBufferMs),
hasLockM(false),
signalStrengthDBmM(0.0),
signalStrengthM(-1),
@ -284,7 +284,7 @@ bool cSatipTuner::Disconnect(void)
currentServerM.Detach();
statusUpdateM.Set(0);
timeoutM = eMinKeepAliveIntervalMs;
timeoutM = eMinKeepAliveIntervalMs - eKeepAlivePreBufferMs;
pmtPidM = -1;
addPidsM.Clear();
delPidsM.Clear();
@ -393,6 +393,7 @@ void cSatipTuner::SetSessionTimeout(const char *sessionP, int timeoutP)
if (nextServerM.IsQuirk(cSatipServer::eSatipQuirkSessionId) && !isempty(*sessionM) && startswith(*sessionM, "0"))
rtspM.SetSession(SkipZeroes(*sessionM));
timeoutM = (timeoutP > eMinKeepAliveIntervalMs) ? timeoutP : eMinKeepAliveIntervalMs;
timeoutM -= eKeepAlivePreBufferMs;
}
void cSatipTuner::SetupTransport(int rtpPortP, int rtcpPortP, const char *streamAddrP, const char *sourceAddrP)

View File

@ -89,6 +89,7 @@ private:
eIdleCheckTimeoutMs = 15000, // in milliseconds
eTuningTimeoutMs = 20000, // in milliseconds
eMinKeepAliveIntervalMs = 30000, // in milliseconds
eKeepAlivePreBufferMs = 2000, // in milliseconds
eSetupTimeoutMs = 2000 // in milliseconds
};
enum eTunerState { tsIdle, tsRelease, tsSet, tsTuned, tsLocked };