X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/211d70fe8a326748743da7642f8b1f3ca10adc94..4cedb788563967100c39c2764be5b9daefc15d1a:/lib/dvb/pmt.cpp diff --git a/lib/dvb/pmt.cpp b/lib/dvb/pmt.cpp index 1b1455e4..a6bde907 100644 --- a/lib/dvb/pmt.cpp +++ b/lib/dvb/pmt.cpp @@ -87,9 +87,9 @@ void eDVBServicePMTHandler::PMTready(int error) { m_have_cached_program = false; serviceEvent(eventNewProgramInfo); - eEPGCache::getInstance()->PMTready(this); if (!m_pvr_channel) // don't send campmt to camd.socket for playbacked services { + eEPGCache::getInstance()->PMTready(this); if(!m_ca_servicePtr) { int demuxes[2] = {0,0}; @@ -178,8 +178,8 @@ int eDVBServicePMTHandler::getProgramInfo(struct program &program) 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_apid_mpeg = m_service->getCacheEntry(eDVBService::cAPID); + cached_apid_ac3 = m_service->getCacheEntry(eDVBService::cAC3PID); cached_tpid = m_service->getCacheEntry(eDVBService::cTPID); } @@ -496,8 +496,9 @@ int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref, int use_decode_demux, } else { eDVBMetaParser parser; - - if (parser.parseFile(ref.path)) + + int ret=parser.parseFile(ref.path); + if (ret || !parser.m_ref.getServiceID().get() /* incorrect sid in meta file or recordings.epl*/ ) { eWarning("no .meta file found, trying to find PMT pid"); eDVBTSTools tstools; @@ -865,36 +866,42 @@ static PyObject *createTuple(int pid, const char *type) return r; } +static inline void PyList_AppendSteal(PyObject *list, PyObject *item) +{ + PyList_Append(list, item); + Py_DECREF(item); +} + PyObject *eDVBServicePMTHandler::program::createPythonObject() { PyObject *r = PyDict_New(); PyObject *l = PyList_New(0); - PyList_Append(l, createTuple(0, "pat")); + PyList_AppendSteal(l, createTuple(0, "pat")); if (pmtPid != -1) - PyList_Append(l, createTuple(pmtPid, "pmt")); + PyList_AppendSteal(l, createTuple(pmtPid, "pmt")); for (std::vector::const_iterator i(videoStreams.begin()); i != videoStreams.end(); ++i) - PyList_Append(l, createTuple(i->pid, "video")); + PyList_AppendSteal(l, createTuple(i->pid, "video")); for (std::vector::const_iterator i(audioStreams.begin()); i != audioStreams.end(); ++i) - PyList_Append(l, createTuple(i->pid, "audio")); + PyList_AppendSteal(l, createTuple(i->pid, "audio")); for (std::vector::const_iterator i(subtitleStreams.begin()); i != subtitleStreams.end(); ++i) - PyList_Append(l, createTuple(i->pid, "subtitle")); + PyList_AppendSteal(l, createTuple(i->pid, "subtitle")); - PyList_Append(l, createTuple(pcrPid, "pcr")); + PyList_AppendSteal(l, createTuple(pcrPid, "pcr")); if (textPid != -1) - PyList_Append(l, createTuple(textPid, "text")); + PyList_AppendSteal(l, createTuple(textPid, "text")); PyDict_SetItemString(r, "pids", l); return r;