From 6661750313ba38cbf5b12cad5177de0e04bdbe89 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 9 Nov 2013 17:02:44 +0100 Subject: [PATCH] sectionsd: work around buggy cDemux in libcoolstream Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4bb5d1bdc02b1748323d69aa3dbe89654dbe8fc8 Author: Stefan Seyfried Date: 2013-11-09 (Sat, 09 Nov 2013) --- src/eitd/sectionsd.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 1e7810fb0..114e4a18a 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -1427,15 +1427,19 @@ void CTimeThread::run() xprintf("%s: getting DVB time (isOpen %d)\n", name.c_str(), isOpen()); int rc; +#if HAVE_COOL_HARDWARE + /* libcoolstream does not like the repeated read if the dmx is not yet running + * (e.g. during neutrino start) and causes strange openthreads errors which in + * turn cause complete malfunction of the dmx, so we cannot use the "speed up + * shutdown" hack on with libcoolstream... :-( */ + rc = dmx->Read(static_buf, MAX_SECTION_LENGTH, timeoutInMSeconds); +#else time_t start = time_monotonic_ms(); /* speed up shutdown by looping around Read() */ do { rc = dmx->Read(static_buf, MAX_SECTION_LENGTH, timeoutInMSeconds / 12); -#if HAVE_COOL_HARDWARE - if (rc < 0) /* libcoolstream returns -1 on timeout ??? ... */ - rc = 0; /* ...and does not set a useful errno (EINVAL) */ -#endif } while (running && rc == 0 && (time_monotonic_ms() - start) < timeoutInMSeconds); +#endif xprintf("%s: getting DVB time done : %d messaging_neutrino_sets_time %d\n", name.c_str(), rc, messaging_neutrino_sets_time); if (rc > 0) { SIsectionTIME st(static_buf);