mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 15:32:59 +02:00
neutrino: stop EIT read before zap
This commit is contained in:
@@ -58,6 +58,7 @@ struct sectionsd
|
|||||||
getIsScanningActive, // commandGetIsScanningActive
|
getIsScanningActive, // commandGetIsScanningActive
|
||||||
getIsTimeSet, // commandGetIsTimeSet
|
getIsTimeSet, // commandGetIsTimeSet
|
||||||
serviceChanged, // commandserviceChanged
|
serviceChanged, // commandserviceChanged
|
||||||
|
serviceStopped, // commandserviceChanged
|
||||||
CMD_registerEvents, // commandRegisterEventClient
|
CMD_registerEvents, // commandRegisterEventClient
|
||||||
CMD_unregisterEvents, // commandUnRegisterEventClient
|
CMD_unregisterEvents, // commandUnRegisterEventClient
|
||||||
freeMemory, // commandFreeMemory
|
freeMemory, // commandFreeMemory
|
||||||
|
@@ -161,6 +161,14 @@ void CSectionsdClient::setServiceChanged(const t_channel_id channel_id, const bo
|
|||||||
close_connection();
|
close_connection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSectionsdClient::setServiceStopped()
|
||||||
|
{
|
||||||
|
send(sectionsd::serviceStopped);
|
||||||
|
|
||||||
|
readResponse();
|
||||||
|
close_connection();
|
||||||
|
}
|
||||||
|
|
||||||
void CSectionsdClient::freeMemory()
|
void CSectionsdClient::freeMemory()
|
||||||
{
|
{
|
||||||
send(sectionsd::freeMemory);
|
send(sectionsd::freeMemory);
|
||||||
|
@@ -182,6 +182,7 @@ class CSectionsdClient : private CBasicClient
|
|||||||
bool getIsTimeSet();
|
bool getIsTimeSet();
|
||||||
void setPauseScanning(const bool doPause);
|
void setPauseScanning(const bool doPause);
|
||||||
void setServiceChanged(const t_channel_id channel_id, const bool requestEvent, int dnum = 0);
|
void setServiceChanged(const t_channel_id channel_id, const bool requestEvent, int dnum = 0);
|
||||||
|
void setServiceStopped();
|
||||||
|
|
||||||
bool getIsScanningActive();
|
bool getIsScanningActive();
|
||||||
|
|
||||||
|
@@ -119,6 +119,8 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data
|
|||||||
//printf("[neutrino] timeout EVT_ZAP current %llx data %llx\n", current_channel_id, *(t_channel_id *)data);
|
//printf("[neutrino] timeout EVT_ZAP current %llx data %llx\n", current_channel_id, *(t_channel_id *)data);
|
||||||
if ((*(t_channel_id *)data) != current_channel_id) {
|
if ((*(t_channel_id *)data) != current_channel_id) {
|
||||||
g_InfoViewer->chanready = 0;
|
g_InfoViewer->chanready = 0;
|
||||||
|
if (!IS_WEBTV(current_channel_id))
|
||||||
|
g_Sectionsd->setServiceStopped();
|
||||||
CMoviePlayerGui::getInstance().stopPlayBack();
|
CMoviePlayerGui::getInstance().stopPlayBack();
|
||||||
g_Zapit->zapTo_serviceID_NOWAIT(current_channel_id );
|
g_Zapit->zapTo_serviceID_NOWAIT(current_channel_id );
|
||||||
//g_Sectionsd->setServiceChanged(current_channel_id, false);
|
//g_Sectionsd->setServiceChanged(current_channel_id, false);
|
||||||
@@ -702,6 +704,8 @@ void CRemoteControl::zapTo_ChannelID(const t_channel_id channel_id, const std::s
|
|||||||
g_RCInput->killTimer(scrambled_timer);
|
g_RCInput->killTimer(scrambled_timer);
|
||||||
//dvbsub_pause(true);
|
//dvbsub_pause(true);
|
||||||
CZapit::getInstance()->Abort();
|
CZapit::getInstance()->Abort();
|
||||||
|
if (!IS_WEBTV(channel_id))
|
||||||
|
g_Sectionsd->setServiceStopped();
|
||||||
CMoviePlayerGui::getInstance().stopPlayBack();
|
CMoviePlayerGui::getInstance().stopPlayBack();
|
||||||
g_Zapit->zapTo_serviceID_NOWAIT(channel_id);
|
g_Zapit->zapTo_serviceID_NOWAIT(channel_id);
|
||||||
|
|
||||||
|
@@ -73,7 +73,6 @@ DMX::DMX()
|
|||||||
|
|
||||||
void DMX::init()
|
void DMX::init()
|
||||||
{
|
{
|
||||||
fd = -1;
|
|
||||||
lastChanged = time_monotonic();
|
lastChanged = time_monotonic();
|
||||||
filter_index = 0;
|
filter_index = 0;
|
||||||
real_pauseCounter = 0;
|
real_pauseCounter = 0;
|
||||||
@@ -124,7 +123,6 @@ void DMX::closefd(void)
|
|||||||
//dmx->Stop();
|
//dmx->Stop();
|
||||||
delete dmx;
|
delete dmx;
|
||||||
dmx = NULL;
|
dmx = NULL;
|
||||||
fd = -1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,6 +281,10 @@ int DMX::getSection(uint8_t *buf, const unsigned timeoutInMSeconds, int &timeout
|
|||||||
}
|
}
|
||||||
|
|
||||||
lock();
|
lock();
|
||||||
|
if (!isOpen()) {
|
||||||
|
unlock();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
int rc = dmx->Read(buf, MAX_SECTION_LENGTH, timeoutInMSeconds);
|
int rc = dmx->Read(buf, MAX_SECTION_LENGTH, timeoutInMSeconds);
|
||||||
|
|
||||||
@@ -492,7 +494,6 @@ int DMX::immediate_start(void)
|
|||||||
dmx = new cDemux(dmx_num);
|
dmx = new cDemux(dmx_num);
|
||||||
dmx->Open(DMX_PSI_CHANNEL, NULL, dmxBufferSizeInKB*1024UL);
|
dmx->Open(DMX_PSI_CHANNEL, NULL, dmxBufferSizeInKB*1024UL);
|
||||||
}
|
}
|
||||||
fd = 1;
|
|
||||||
|
|
||||||
/* setfilter() only if this is no dummy filter... */
|
/* setfilter() only if this is no dummy filter... */
|
||||||
if (filters[filter_index].filter && filters[filter_index].mask)
|
if (filters[filter_index].filter && filters[filter_index].mask)
|
||||||
|
@@ -53,7 +53,6 @@ class DMX
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
int fd;
|
|
||||||
cDemux * dmx;
|
cDemux * dmx;
|
||||||
int dmx_num;
|
int dmx_num;
|
||||||
unsigned short pID;
|
unsigned short pID;
|
||||||
@@ -69,7 +68,7 @@ protected:
|
|||||||
bool seen_section;
|
bool seen_section;
|
||||||
|
|
||||||
inline bool isOpen(void) {
|
inline bool isOpen(void) {
|
||||||
return (fd != -1);
|
return (dmx != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int immediate_start(void); /* mutex must be locked before and unlocked after this method */
|
int immediate_start(void); /* mutex must be locked before and unlocked after this method */
|
||||||
|
@@ -260,6 +260,7 @@ class CCNThread : public CEventsThread
|
|||||||
void sendCNEvent();
|
void sendCNEvent();
|
||||||
public:
|
public:
|
||||||
CCNThread();
|
CCNThread();
|
||||||
|
void stopUpdate();
|
||||||
bool checkUpdate();
|
bool checkUpdate();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -968,6 +968,20 @@ static void commandserviceChanged(int connfd, char *data, const unsigned dataLen
|
|||||||
dprintf("[sectionsd] commandserviceChanged: Service changed to " PRINTF_CHANNEL_ID_TYPE "\n", uniqueServiceKey);
|
dprintf("[sectionsd] commandserviceChanged: Service changed to " PRINTF_CHANNEL_ID_TYPE "\n", uniqueServiceKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
xprintf("[sectionsd] commandserviceStopped done\n");
|
||||||
|
}
|
||||||
|
|
||||||
static void commandGetIsScanningActive(int connfd, char* /*data*/, const unsigned /*dataLength*/)
|
static void commandGetIsScanningActive(int connfd, char* /*data*/, const unsigned /*dataLength*/)
|
||||||
{
|
{
|
||||||
struct sectionsd::msgResponseHeader responseHeader;
|
struct sectionsd::msgResponseHeader responseHeader;
|
||||||
@@ -1233,6 +1247,7 @@ static s_cmd_table connectionCommands[sectionsd::numberOfCommands] = {
|
|||||||
{ commandGetIsScanningActive, "commandGetIsScanningActive" },
|
{ commandGetIsScanningActive, "commandGetIsScanningActive" },
|
||||||
{ commandGetIsTimeSet, "commandGetIsTimeSet" },
|
{ commandGetIsTimeSet, "commandGetIsTimeSet" },
|
||||||
{ commandserviceChanged, "commandserviceChanged" },
|
{ commandserviceChanged, "commandserviceChanged" },
|
||||||
|
{ commandserviceStopped, "commandserviceStopped" },
|
||||||
{ commandRegisterEventClient, "commandRegisterEventClient" },
|
{ commandRegisterEventClient, "commandRegisterEventClient" },
|
||||||
{ commandUnRegisterEventClient, "commandUnRegisterEventClient" },
|
{ commandUnRegisterEventClient, "commandUnRegisterEventClient" },
|
||||||
{ commandFreeMemory, "commandFreeMemory" },
|
{ commandFreeMemory, "commandFreeMemory" },
|
||||||
@@ -1786,7 +1801,7 @@ void CCNThread::beforeWait()
|
|||||||
update_mutex.unlock();
|
update_mutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCNThread::afterWait()
|
void CCNThread::stopUpdate()
|
||||||
{
|
{
|
||||||
xprintf("%s: stop eit update filter (%s)\n", name.c_str(), updating ? "active" : "not active");
|
xprintf("%s: stop eit update filter (%s)\n", name.c_str(), updating ? "active" : "not active");
|
||||||
update_mutex.lock();
|
update_mutex.lock();
|
||||||
@@ -1797,6 +1812,11 @@ void CCNThread::afterWait()
|
|||||||
update_mutex.unlock();
|
update_mutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCNThread::afterWait()
|
||||||
|
{
|
||||||
|
stopUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
void CCNThread::beforeSleep()
|
void CCNThread::beforeSleep()
|
||||||
{
|
{
|
||||||
if (sendToSleepNow && messaging_have_CN == 0x00) {
|
if (sendToSleepNow && messaging_have_CN == 0x00) {
|
||||||
|
Reference in New Issue
Block a user