X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/fe12fe9e0ab3a4f9751b67c0aa3751d5864784ba..8c68c9fd6273e5318755e42a9f650d850daebb94:/lib/dvb_ci/dvbci.cpp diff --git a/lib/dvb_ci/dvbci.cpp b/lib/dvb_ci/dvbci.cpp index c34ea0c0..8fa1bca2 100644 --- a/lib/dvb_ci/dvbci.cpp +++ b/lib/dvb_ci/dvbci.cpp @@ -332,6 +332,20 @@ void eDVBCIInterfaces::recheckPMTHandlers() eDebug("'%s' is in service list of slot %d... so use it", ref.toString().c_str(), ci_it->getSlotID()); useThis = true; } + else // check parent + { + eServiceReferenceDVB parent_ref = ref.getParentServiceReference(); + if (parent_ref) + { + it = ci_it->possible_services.find(ref); + if (it != ci_it->possible_services.end()) + { + eDebug("parent '%s' of '%s' is in service list of slot %d... so use it", + parent_ref.toString().c_str(), ref.toString().c_str(), ci_it->getSlotID()); + useThis = true; + } + } + } } if (!useThis && !ci_it->possible_providers.empty()) { @@ -354,6 +368,7 @@ void eDVBCIInterfaces::recheckPMTHandlers() } if (!useThis && !ci_it->possible_caids.empty()) { + mask |= 4; for (CAID_LIST::iterator ca(caids.begin()); ca != caids.end(); ++ca) { caidSet::iterator it = ci_it->possible_caids.find(*ca); @@ -882,14 +897,14 @@ RESULT eDVBCIInterfaces::setDescrambleRules(int slotid, SWIG_PYOBJECT(ePyObject) { --size; ePyObject caid = PyList_GET_ITEM(caid_list, size); - if (!PyInt_Check(caid)) + if (!PyLong_Check(caid)) { char buf[255]; snprintf(buf, 255, "eDVBCIInterfaces::setDescrambleRules entry in caid list is not a long it is '%s'!!", PyObject_TypeStr(caid)); PyErr_SetString(PyExc_StandardError, buf); return -1; } - int tmpcaid = PyInt_AsLong(caid); + int tmpcaid = PyLong_AsLong(caid); if (tmpcaid > 0 && tmpcaid < 0x10000) slot->possible_caids.insert(tmpcaid); else @@ -906,13 +921,21 @@ PyObject *eDVBCIInterfaces::readCICaIds(int slotid) char tmp[255]; snprintf(tmp, 255, "eDVBCIInterfaces::readCICaIds try to get CAIds for CI Slot %d... but just %d slots are available", slotid, m_slots.size()); PyErr_SetString(PyExc_StandardError, tmp); - return 0; } - int idx=0; - ePyObject list = PyList_New(slot->possible_caids.size()); - for (caidSet::iterator it = slot->possible_caids.begin(); it != slot->possible_caids.end(); ++it) - PyList_SET_ITEM(list, idx++, PyLong_FromLong(*it)); - return list; + else + { + int idx=0; + eDVBCICAManagerSession *ca_manager = slot->getCAManager(); + const std::vector *ci_caids = ca_manager ? &ca_manager->getCAIDs() : 0; + ePyObject list = PyList_New(ci_caids ? ci_caids->size() : 0); + if (ci_caids) + { + for (std::vector::const_iterator it = ci_caids->begin(); it != ci_caids->end(); ++it) + PyList_SET_ITEM(list, idx++, PyLong_FromLong(*it)); + } + return list; + } + return 0; } int eDVBCISlot::send(const unsigned char *data, size_t len)