try to fix segfault on TDT time sync

Origin commit data
------------------
Commit: 328a0a953d
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2018-02-14 (Wed, 14 Feb 2018)
This commit is contained in:
Jacek Jendrzej
2018-02-14 21:58:22 +01:00
committed by vanhofen
parent bb4f256562
commit 7cd511686b

View File

@@ -1490,10 +1490,12 @@ void CTimeThread::run()
#else
int64_t start = time_monotonic_ms();
/* speed up shutdown by looping around Read() */
DMX::lock();
do {
rc = dmx->Read(static_buf, MAX_SECTION_LENGTH, timeoutInMSeconds / 12);
} while (running && rc == 0
&& (time_monotonic_ms() - start) < (int64_t)timeoutInMSeconds);
DMX::unlock();
#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);