mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 01:11:06 +02:00
sectionsd: work around buggy cDemux in libcoolstream
Origin commit data
------------------
Commit: 4bb5d1bdc0
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-11-09 (Sat, 09 Nov 2013)
This commit is contained in:
@@ -1427,15 +1427,19 @@ void CTimeThread::run()
|
|||||||
|
|
||||||
xprintf("%s: getting DVB time (isOpen %d)\n", name.c_str(), isOpen());
|
xprintf("%s: getting DVB time (isOpen %d)\n", name.c_str(), isOpen());
|
||||||
int rc;
|
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();
|
time_t start = time_monotonic_ms();
|
||||||
/* speed up shutdown by looping around Read() */
|
/* speed up shutdown by looping around Read() */
|
||||||
do {
|
do {
|
||||||
rc = dmx->Read(static_buf, MAX_SECTION_LENGTH, timeoutInMSeconds / 12);
|
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);
|
} 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);
|
xprintf("%s: getting DVB time done : %d messaging_neutrino_sets_time %d\n", name.c_str(), rc, messaging_neutrino_sets_time);
|
||||||
if (rc > 0) {
|
if (rc > 0) {
|
||||||
SIsectionTIME st(static_buf);
|
SIsectionTIME st(static_buf);
|
||||||
|
Reference in New Issue
Block a user