eitd/sectionsd.cpp: new bugs fixes: block change() until time is set;

always wakeup time thread when unpaused
This commit is contained in:
[CST] Focus
2012-03-16 20:37:21 +04:00
parent 628d3a1855
commit b144aeb952

View File

@@ -870,7 +870,7 @@ static void commandPauseScanning(int connfd, char *data, const unsigned dataLeng
scanning = 1; scanning = 1;
/* FIXME should we stop time updates if not scanning ? flag if ntp update was good ? */ /* FIXME should we stop time updates if not scanning ? flag if ntp update was good ? */
if (!ntpenable) //if (!ntpenable)
{ {
threadTIME.change(0); threadTIME.change(0);
} }
@@ -1381,6 +1381,8 @@ void CTimeThread::run()
name.c_str(), sleep_time, running, scanning); name.c_str(), sleep_time, running, scanning);
#endif #endif
do { do {
if(!scanning)
sleep_time = 0;
real_pause(); real_pause();
int rs = Sleep(); int rs = Sleep();
#ifdef DEBUG_TIME_THREAD #ifdef DEBUG_TIME_THREAD
@@ -1482,11 +1484,13 @@ void CSectionThread::run()
addFilters(); addFilters();
real_pauseCounter = 1;
if (wait_for_time) { if (wait_for_time) {
threadTIME.waitForTimeset(); threadTIME.waitForTimeset();
time_t now = time(NULL); time_t now = time(NULL);
xprintf("%s::run:: time set: %s", name.c_str(), ctime(&now)); xprintf("%s::run:: time set: %s", name.c_str(), ctime(&now));
} }
real_pauseCounter = 0;
DMX::start(); DMX::start();