add VIASAT EPG based on martii

This commit is contained in:
TangoCash
2015-05-13 21:14:03 +02:00
committed by svenhoefer
parent ab8353be04
commit eb81369965
2 changed files with 18 additions and 4 deletions

View File

@@ -272,7 +272,7 @@ int DMX::getSection(uint8_t *buf, const unsigned timeoutInMSeconds, int &timeout
eit_extended_section_header *eit_extended_header;
/* filter == 0 && maks == 0 => EIT dummy filter to slow down EIT thread startup */
if (pID == 0x12 && filters[filter_index].filter == 0 && filters[filter_index].mask == 0)
if ((pID == 0x12 || pID == 0x39) && filters[filter_index].filter == 0 && filters[filter_index].mask == 0)
{
//dprintf("dmx: dummy filter, sleeping for %d ms\n", timeoutInMSeconds);
usleep(timeoutInMSeconds * 1000);
@@ -392,7 +392,7 @@ int DMX::getSection(uint8_t *buf, const unsigned timeoutInMSeconds, int &timeout
unsigned short current_tsid = 0;
uint8_t segment_last_section_number = last_section_number;
if (pID == 0x12) {
if (pID == 0x12 || pID == 0x39) {
eit_extended_header = (eit_extended_section_header *)(buf+8);
current_onid = eit_extended_header->original_network_id_hi * 256 +
eit_extended_header->original_network_id_lo;
@@ -404,7 +404,7 @@ int DMX::getSection(uint8_t *buf, const unsigned timeoutInMSeconds, int &timeout
sections_id_t s_id = create_sections_id(table_id, eh_tbl_extension_id, current_onid, current_tsid, section_number);
bool complete = false;
if (pID == 0x12)
if (pID == 0x12 || pID == 0x39)
complete = check_complete(s_id, section_number, last_section_number, segment_last_section_number);
/* if we are not caching the already read sections (CN-thread), check EIT version and get out */
@@ -647,7 +647,7 @@ int DMX::change(const int new_filter_index, const t_channel_id new_current_servi
}
if (sections_debug) { // friendly debug output...
if(pID==0x12 && filters[0].filter != 0x4e) { // Only EIT
if((pID==0x12 || pID==0x39) && filters[0].filter != 0x4e) { // Only EIT
printdate_ms(stderr);
fprintf(stderr, "changeDMX [EIT]-> %d (0x%x/0x%x) %s (%ld seconds)\n",
new_filter_index, filters[new_filter_index].filter,

View File

@@ -132,6 +132,8 @@ OpenThreads::Mutex filter_mutex;
static CTimeThread threadTIME;
static CEitThread threadEIT;
static CCNThread threadCN;
// ViaSAT uses pid 0x39 instead of 0x12
static CEitThread threadVSEIT("viasatThread", 0x39);
#ifdef ENABLE_FREESATEPG
static CFreeSatThread threadFSEIT;
@@ -836,6 +838,7 @@ static void wakeupAll()
{
threadCN.change(0);
threadEIT.change(0);
threadVSEIT.change(0);
#ifdef ENABLE_FREESATEPG
threadFSEIT.change(0);
#endif
@@ -958,6 +961,7 @@ static void commandserviceChanged(int connfd, char *data, const unsigned dataLen
threadCN.setCurrentService(messaging_current_servicekey);
threadEIT.setDemux(cmd->dnum);
threadEIT.setCurrentService(uniqueServiceKey /*messaging_current_servicekey*/);
threadVSEIT.setCurrentService(messaging_current_servicekey);
#ifdef ENABLE_FREESATEPG
threadFSEIT.setCurrentService(messaging_current_servicekey);
#endif
@@ -1712,6 +1716,11 @@ CEitThread::CEitThread()
{
}
CEitThread::CEitThread(std::string tname, unsigned short pid)
: CEventsThread(tname, pid)
{
}
/* EIT thread hooks */
void CEitThread::addFilters()
{
@@ -2215,6 +2224,7 @@ printf("SIevent size: %d\n", (int)sizeof(SIevent));
threadTIME.Start();
threadEIT.Start();
threadCN.Start();
threadVSEIT.Start();
#ifdef ENABLE_FREESATEPG
threadFSEIT.Start();
@@ -2253,6 +2263,7 @@ printf("SIevent size: %d\n", (int)sizeof(SIevent));
threadEIT.StopRun();
threadCN.StopRun();
threadTIME.StopRun();
threadVSEIT.StopRun();
#ifdef ENABLE_SDT
threadSDT.StopRun();
#endif
@@ -2277,6 +2288,9 @@ printf("SIevent size: %d\n", (int)sizeof(SIevent));
xprintf("join CN\n");
threadCN.Stop();
xprintf("join VSEIT\n");
threadVSEIT.Stop();
#ifdef ENABLE_SDT
xprintf("join SDT\n");
threadSDT.Stop();