-
- m_SDT = new eTable<ServiceDescriptionSection>();
- if (m_SDT->start(m_demux, eDVBSDTSpec()))
- return -1;
- CONNECT(m_SDT->tableReady, eDVBScan::SDTready);
-
- m_NIT = 0;
- m_NIT = new eTable<NetworkInformationSection>();
- if (m_NIT->start(m_demux, eDVBNITSpec()))
- return -1;
- CONNECT(m_NIT->tableReady, eDVBScan::NITready);
-
- m_BAT = new eTable<BouquetAssociationSection>();
- if (m_BAT->start(m_demux, eDVBBATSpec()))
- return -1;
- CONNECT(m_BAT->tableReady, eDVBScan::BATready);
-
+
+ /* only start required filters filter */
+
+ if (m_ready_all & readyPAT)
+ startSDT = m_ready & readyPAT;
+
+ m_SDT = 0;
+ if (startSDT && (m_ready_all & readySDT))
+ {
+ m_SDT = new eTable<ServiceDescriptionSection>();
+ int tsid=-1;
+ if (m_ready & readyPAT && m_ready & validPAT)
+ {
+ std::vector<ProgramAssociationSection*>::const_iterator i =
+ m_PAT->getSections().begin();
+ assert(i != m_PAT->getSections().end());
+ tsid = (*i)->getTableIdExtension(); // in PAT this is the transport stream id
+
+ // KabelBW HACK ... on 618Mhz and 626Mhz the transport stream id in PAT and SDT is different
+ {
+ int type;
+ m_ch_current->getSystem(type);
+ if (type == iDVBFrontend::feCable)
+ {
+ eDVBFrontendParametersCable parm;
+ m_ch_current->getDVBC(parm);
+ if ((tsid == 0x00d7 && abs(parm.frequency-618000) < 2000) ||
+ (tsid == 0x00d8 && abs(parm.frequency-626000) < 2000))
+ tsid = -1;
+ }
+ }
+ }
+ if (tsid == -1)
+ {
+ if (m_SDT->start(m_demux, eDVBSDTSpec()))
+ return -1;
+ }
+ else if (m_SDT->start(m_demux, eDVBSDTSpec(tsid, true)))
+ return -1;
+ CONNECT(m_SDT->tableReady, eDVBScan::SDTready);
+ }
+
+ if (!(m_ready & readyPAT))
+ {
+ m_PAT = 0;
+ if (m_ready_all & readyPAT)
+ {
+ m_PAT = new eTable<ProgramAssociationSection>();
+ if (m_PAT->start(m_demux, eDVBPATSpec()))
+ return -1;
+ CONNECT(m_PAT->tableReady, eDVBScan::PATready);
+ }
+
+ m_NIT = 0;
+ if (m_ready_all & readyNIT)
+ {
+ m_NIT = new eTable<NetworkInformationSection>();
+ if (m_NIT->start(m_demux, eDVBNITSpec()))
+ return -1;
+ CONNECT(m_NIT->tableReady, eDVBScan::NITready);
+ }
+
+ m_BAT = 0;
+ if (m_ready_all & readyBAT)
+ {
+ m_BAT = new eTable<BouquetAssociationSection>();
+ if (m_BAT->start(m_demux, eDVBBATSpec()))
+ return -1;
+ CONNECT(m_BAT->tableReady, eDVBScan::BATready);
+ }
+ }
+