add frequently reload xmltv epg

This commit is contained in:
TangoCash
2021-09-02 20:51:30 +02:00
committed by Thilo Graf
parent 772dae5e24
commit dd7507fe37
5 changed files with 20 additions and 1 deletions

View File

@@ -84,7 +84,8 @@ class CSectionsdClient : private CBasicClient
EVT_SERVICES_UPDATE,
EVT_BOUQUETS_UPDATE,
#endif
EVT_WRITE_SI_FINISHED
EVT_WRITE_SI_FINISHED,
EVT_RELOAD_XMLTV
};
struct epgflags {

View File

@@ -1033,6 +1033,10 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6
case CSectionsdClient::EVT_BOUQUETS_UPDATE:
break;
#endif
case CSectionsdClient::EVT_RELOAD_XMLTV:
*msg = NeutrinoMessages::EVT_RELOAD_XMLTV;
*data = 0;
break;
default:
printf("[neutrino] event INITID_SECTIONSD - unknown eventID 0x%x\n", emsg.eventID );
}

View File

@@ -2213,6 +2213,8 @@ static void *houseKeepingThread(void *)
perror("sectionsd: pthread_create()");
}
pthread_attr_destroy(&attr);
eventServer->sendEvent(CSectionsdClient::EVT_RELOAD_XMLTV, CEventServer::INITID_SECTIONSD);
}
ecount = 0;
}

View File

@@ -2876,6 +2876,7 @@ void CNeutrinoApp::InitSectiondClient()
g_Sectionsd->registerEvent(CSectionsdClient::EVT_GOT_CN_EPG, 222, NEUTRINO_UDS_NAME);
g_Sectionsd->registerEvent(CSectionsdClient::EVT_EIT_COMPLETE, 222, NEUTRINO_UDS_NAME);
g_Sectionsd->registerEvent(CSectionsdClient::EVT_WRITE_SI_FINISHED, 222, NEUTRINO_UDS_NAME);
g_Sectionsd->registerEvent(CSectionsdClient::EVT_RELOAD_XMLTV, 222, NEUTRINO_UDS_NAME);
}
#if HAVE_CST_HARDWARE
@@ -4662,6 +4663,14 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
g_volume->setVolumeExt((int)data);
return messages_return::handled;
}
else if (msg == NeutrinoMessages::EVT_RELOAD_XMLTV) {
for (std::list<std::string>::iterator it = g_settings.xmltv_xml.begin(); it != g_settings.xmltv_xml.end(); ++it)
{
printf("CNeutrinoApp::handleMsg: Reading xmltv epg from %s ...\n", (*it).c_str());
g_Sectionsd->readSIfromXMLTV((*it).c_str());
}
return messages_return::handled;
}
if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000)) {
INFO("###################################### DELETED msg %lx data %lx\n", msg, data);
delete [] (unsigned char*) data;

View File

@@ -124,6 +124,9 @@ struct NeutrinoMessages {
EVT_CA_MESSAGE = CRCInput::RC_Events + 60, /* data = CA_MESSAGE pointer */
EVT_SUBT_MESSAGE = CRCInput::RC_Events + 61, /* data = subtitles pointer */
EVT_AUTO_SET_VIDEOSYSTEM = CRCInput::RC_Events + 62, /* data = new video system */
/* sectionsd */
EVT_RELOAD_XMLTV = CRCInput::RC_Events + 63,
/* END */
EVT_CURRENTEPG = CRCInput::RC_WithData + 1,