second try to fix segfault on TDT time sync

Origin commit data
------------------
Commit: ebb3386d38
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2018-02-15 (Thu, 15 Feb 2018)
This commit is contained in:
Jacek Jendrzej
2018-02-15 18:57:59 +01:00
committed by vanhofen
parent 3e4471e38a
commit 7b22f59dcc

View File

@@ -1489,11 +1489,11 @@ void CTimeThread::run()
rc = dmx->Read(static_buf, MAX_SECTION_LENGTH, timeoutInMSeconds);
#else
int64_t start = time_monotonic_ms();
int timeouts = 0;
/* speed up shutdown by looping around Read() */
do {
rc = dmx->Read(static_buf, MAX_SECTION_LENGTH, timeoutInMSeconds / 12);
} while (running && rc == 0
&& (time_monotonic_ms() - start) < (int64_t)timeoutInMSeconds);
rc = getSection(static_buf, timeoutInMSeconds /6,timeouts);
} while (running && rc < 1 && (time_monotonic_ms() - start) < (int64_t)timeoutInMSeconds*2);
#endif
xprintf("%s: get DVB time ch 0x%012" PRIx64 " rc: %d neutrino_sets_time %d\n",
name.c_str(), current_service, rc, messaging_neutrino_sets_time);