mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-13 00:13:37 +02:00
3. try ;) : copy from TangoCash sectiond
Origin commit data
------------------
Branch: ni/coolstream
Commit: 7eed63f12e
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2018-02-17 (Sat, 17 Feb 2018)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -56,7 +56,9 @@
|
|||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
#include <compatibility.h>
|
#include <compatibility.h>
|
||||||
|
#if ! HAVE_COOL_HARDWARE
|
||||||
|
#include <poll.h>
|
||||||
|
#endif
|
||||||
//#define ENABLE_SDT //FIXME
|
//#define ENABLE_SDT //FIXME
|
||||||
|
|
||||||
//#define DEBUG_SDT_THREAD
|
//#define DEBUG_SDT_THREAD
|
||||||
@@ -1489,15 +1491,27 @@ void CTimeThread::run()
|
|||||||
rc = dmx->Read(static_buf, MAX_SECTION_LENGTH, timeoutInMSeconds);
|
rc = dmx->Read(static_buf, MAX_SECTION_LENGTH, timeoutInMSeconds);
|
||||||
#else
|
#else
|
||||||
int64_t start = time_monotonic_ms();
|
int64_t start = time_monotonic_ms();
|
||||||
int timeouts = 0;
|
|
||||||
/* speed up shutdown by looping around Read() */
|
/* speed up shutdown by looping around Read() */
|
||||||
|
struct pollfd ufds;
|
||||||
|
ufds.events = POLLIN|POLLPRI|POLLERR;
|
||||||
|
DMX::lock();
|
||||||
|
ufds.fd = dmx->getFD();
|
||||||
|
DMX::unlock();
|
||||||
do {
|
do {
|
||||||
rc = getSection(static_buf, timeoutInMSeconds /6,timeouts);
|
ufds.revents = 0;
|
||||||
} while (running && rc < 1 && (time_monotonic_ms() - start) < (int64_t)timeoutInMSeconds*2);
|
rc = ::poll(&ufds, 1, timeoutInMSeconds / 36);
|
||||||
|
if (running && rc == 1) {
|
||||||
|
DMX::lock();
|
||||||
|
if (ufds.fd == dmx->getFD()){
|
||||||
|
rc = dmx->Read(static_buf, MAX_SECTION_LENGTH, 10);
|
||||||
|
}
|
||||||
|
DMX::unlock();
|
||||||
|
}
|
||||||
|
} while (running && rc == 0 && (time_monotonic_ms() < (int64_t)timeoutInMSeconds + start));
|
||||||
#endif
|
#endif
|
||||||
xprintf("%s: get DVB time ch 0x%012" PRIx64 " rc: %d neutrino_sets_time %d\n",
|
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);
|
name.c_str(), current_service, rc, messaging_neutrino_sets_time);
|
||||||
if (rc > 0) {
|
if (rc > 3) {
|
||||||
SIsectionTIME st(static_buf);
|
SIsectionTIME st(static_buf);
|
||||||
if (st.is_parsed()) {
|
if (st.is_parsed()) {
|
||||||
dvb_time = st.getTime();
|
dvb_time = st.getTime();
|
||||||
|
Reference in New Issue
Block a user