eitd/sectionsd.cpp: try to fix filter restart on service stop

This commit is contained in:
[CST] Focus
2014-12-23 19:07:51 +03:00
parent 97875b4855
commit f816efadc6
2 changed files with 10 additions and 10 deletions

View File

@@ -283,7 +283,7 @@ int DMX::getSection(uint8_t *buf, const unsigned timeoutInMSeconds, int &timeout
lock();
if (!isOpen()) {
unlock();
timeouts = -1;
timeouts = -3;
return -1;
}

View File

@@ -972,15 +972,11 @@ static void commandserviceChanged(int connfd, char *data, const unsigned dataLen
static void commandserviceStopped(int connfd, char * /* data */, const unsigned /* dataLength */)
{
xprintf("[sectionsd] commandserviceStopped\n");
sendEmptyResponse(connfd, NULL, 0);
threadCN.lock();
threadEIT.lock();
threadCN.closefd();
threadEIT.closefd();
threadCN.unlock();
threadEIT.unlock();
threadCN.stopUpdate();
current_channel_id = 0;
sendEmptyResponse(connfd, NULL, 0);
threadEIT.stop();
threadCN.stop();
threadCN.stopUpdate();
xprintf("[sectionsd] commandserviceStopped done\n");
}
@@ -1585,8 +1581,12 @@ void CSectionThread::run()
xprintf("%s: skipping to next filter %d from %d (timeouts %d)\n",
name.c_str(), filter_index+1, (int)filters.size(), timeoutsDMX);
#endif
if (timeoutsDMX == -3)
sendToSleepNow = true;
else
need_change = true;
timeoutsDMX = 0;
need_change = true;
}
if (zeit > lastChanged + skipTime) {
#ifdef DEBUG_SECTION_THREADS