From 7b22f59dcca84b2992e41aeed38c687c22c534ed Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 15 Feb 2018 18:57:59 +0100 Subject: [PATCH] second try to fix segfault on TDT time sync Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ebb3386d384bba47848981bb0b84f7c2c28bff25 Author: Jacek Jendrzej Date: 2018-02-15 (Thu, 15 Feb 2018) --- src/eitd/sectionsd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 56bef99e7..b9478d43f 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -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);