From: Jaroslav Kysela Date: Mon, 3 Dec 2018 19:42:27 +0000 (+0100) Subject: satip client: activity timeout cleanups X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8635ae50145a91eb8c245b49b0e6662cf1429792;p=thirdparty%2Ftvheadend.git satip client: activity timeout cleanups --- diff --git a/src/input/mpegts/satip/satip_frontend.c b/src/input/mpegts/satip/satip_frontend.c index a87b20234..8e7f93024 100644 --- a/src/input/mpegts/satip/satip_frontend.c +++ b/src/input/mpegts/satip/satip_frontend.c @@ -1585,7 +1585,7 @@ satip_frontend_input_thread ( void *aux ) int rtsp_flags, position, reply; uint32_t seq, unc; udp_multirecv_t um; - uint64_t u64, u64_2; + uint64_t u64, u64_2, fatal_timeout; long stream_id; /* If set - the thread will be cancelled */ @@ -1890,6 +1890,7 @@ new_tune: lfe->sf_skip_ts = MINMAX(lfe->sf_device->sd_skip_ts, 0, 200) * 188; lfe->sf_last_activity_tstamp = mclk(); + fatal_timeout = sec2mono(5 + MINMAX(lfe->sf_grace_period, 0, 60)); while ((reply || running) && !fatal) { @@ -1933,7 +1934,7 @@ new_tune: continue; } - if (lfe->sf_last_activity_tstamp + sec2mono(5) < mclk()) { + if (lfe->sf_last_activity_tstamp + fatal_timeout < mclk()) { tvhwarn(LS_SATIP, "%s - no data received, restarting RTSP", buf); satip_frontend_tuning_error(lfe, tr); fatal = 1; @@ -2062,7 +2063,7 @@ new_tune: if (c > 0) { lfe->sf_last_activity_tstamp = mclk(); tvh_mutex_lock(&lfe->sf_dvr_lock); - if (lfe->sf_req == lfe->sf_req_thread) + if (lfe->sf_req == lfe->sf_req_thread) satip_frontend_decode_rtcp(lfe, buf, mmi, b, c); tvh_mutex_unlock(&lfe->sf_dvr_lock); }