X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/24c472e37de8db4007cdd4c5d67d3fd4e914f0b1..948213ba7e5d1bc6a9c4d7f5f9d35c53186b60d3:/lib/dvb/pmt.cpp diff --git a/lib/dvb/pmt.cpp b/lib/dvb/pmt.cpp index d0119508..d6f002e6 100644 --- a/lib/dvb/pmt.cpp +++ b/lib/dvb/pmt.cpp @@ -160,27 +160,27 @@ PyObject *eDVBServicePMTHandler::getCaIds() int eDVBServicePMTHandler::getProgramInfo(struct program &program) { ePtr > ptr; + int cached_apid_ac3 = -1; + int cached_apid_mpeg = -1; + int cached_vpid = -1; + int cached_tpid = -1; program.videoStreams.clear(); program.audioStreams.clear(); program.pcrPid = -1; program.pmtPid = -1; program.textPid = -1; - program.audioChannel = m_service ? m_service->getCacheEntry(eDVBService::cACHANNEL) : -1; + + if ( m_service && !m_service->cacheEmpty() ) + { + cached_vpid = m_service->getCacheEntry(eDVBService::cVPID); + cached_apid_mpeg = m_service->getCacheEntry(eDVBService::cAC3PID); + cached_apid_ac3 = m_service->getCacheEntry(eDVBService::cAPID); + cached_tpid = m_service->getCacheEntry(eDVBService::cTPID); + } if ( ((m_service && m_service->usePMT()) || !m_service) && !m_PMT.getCurrent(ptr)) { - int cached_apid_ac3 = -1; - int cached_apid_mpeg = -1; - int cached_vpid = -1; - int cached_tpid = -1; - if ( m_service && !m_service->cacheEmpty() ) - { - cached_vpid = m_service->getCacheEntry(eDVBService::cVPID); - cached_apid_mpeg = m_service->getCacheEntry(eDVBService::cAC3PID); - cached_apid_ac3 = m_service->getCacheEntry(eDVBService::cAPID); - cached_tpid = m_service->getCacheEntry(eDVBService::cTPID); - } eDVBTableSpec table_spec; ptr->getSpec(table_spec); program.pmtPid = table_spec.pid < 0x1fff ? table_spec.pid : -1; @@ -313,48 +313,44 @@ int eDVBServicePMTHandler::getProgramInfo(struct program &program) return 0; } else if ( m_service && !m_service->cacheEmpty() ) { - int vpid = m_service->getCacheEntry(eDVBService::cVPID), - apid_ac3 = m_service->getCacheEntry(eDVBService::cAC3PID), - apid_mpeg = m_service->getCacheEntry(eDVBService::cAPID), - pcrpid = m_service->getCacheEntry(eDVBService::cPCRPID), - tpid = m_service->getCacheEntry(eDVBService::cTPID), + int cached_pcrpid = m_service->getCacheEntry(eDVBService::cPCRPID), vpidtype = m_service->getCacheEntry(eDVBService::cVTYPE), cnt=0; if ( vpidtype == -1 ) vpidtype = videoStream::vtMPEG2; - if ( vpid != -1 ) + if ( cached_vpid != -1 ) { videoStream s; - s.pid = vpid; + s.pid = cached_vpid; s.type = vpidtype; program.videoStreams.push_back(s); ++cnt; } - if ( apid_ac3 != -1 ) + if ( cached_apid_ac3 != -1 ) { audioStream s; s.type = audioStream::atAC3; - s.pid = apid_ac3; + s.pid = cached_apid_ac3; program.audioStreams.push_back(s); ++cnt; } - if ( apid_mpeg != -1 ) + if ( cached_apid_mpeg != -1 ) { audioStream s; s.type = audioStream::atMPEG; - s.pid = apid_mpeg; + s.pid = cached_apid_mpeg; program.audioStreams.push_back(s); ++cnt; } - if ( pcrpid != -1 ) + if ( cached_pcrpid != -1 ) { ++cnt; - program.pcrPid = pcrpid; + program.pcrPid = cached_pcrpid; } - if ( tpid != -1 ) + if ( cached_tpid != -1 ) { ++cnt; - program.textPid = tpid; + program.textPid = cached_tpid; } CAID_LIST &caids = m_service->m_ca; for (CAID_LIST::iterator it(caids.begin()); it != caids.end(); ++it)