#include <dvbsi++/ca_program_map_section.h>
-#undef CIDEBUG
+//#define CIDEBUG 1
#ifdef CIDEBUG
#define eDebugCI(x...) eDebug(x)
eDVBCISlot *tmp = it->cislot;
eDVBServicePMTHandler *pmthandler = it->pmthandler;
eDVBServicePMTHandler::program p;
+ bool first_plugged_cis_exist = false;
pmthandler->getServiceReference(ref);
pmthandler->getService(service);
eDebugCI("recheck %p %s", pmthandler, ref.toString().c_str());
+ for (eSmartPtrList<eDVBCISlot>::iterator ci_it(m_slots.begin()); ci_it != m_slots.end(); ++ci_it)
+ if (ci_it->first_plugged && ci_it->getCAManager())
+ {
+ eDebug("Slot %d first plugged", ci_it->getSlotID());
+ ci_it->first_plugged = false;
+ first_plugged_cis_exist = true;
+ }
// check if this pmt handler has already assigned CI(s) .. and this CI(s) are already running
- while(tmp)
- {
- if (!tmp->running_services.empty())
- break;
- tmp=tmp->linked_next;
- }
- if (tmp) // we dont like to change tsmux for running services
+ if (!first_plugged_cis_exist)
{
- eDebugCI("already assigned and running CI!\n");
- continue;
+ while(tmp)
+ {
+ if (!tmp->running_services.empty())
+ break;
+ tmp=tmp->linked_next;
+ }
+ if (tmp) // we dont like to change tsmux for running services
+ {
+ eDebugCI("already assigned and running CI!\n");
+ continue;
+ }
}
if (!pmthandler->getProgramInfo(p))
void eDVBCISlot::data(int what)
{
+ eDebugCI("CISlot %d what %d\n", getSlotID(), what);
if(what == eSocketNotifier::Priority) {
if(state != stateRemoved) {
state = stateRemoved;
use_count = 0;
linked_next = 0;
user_mapped = false;
+ first_plugged = true;
slotid = nr;
fd = ::open(filename, O_RDWR | O_NONBLOCK);
- eDebug("CI Slot %d has fd %d", getSlotID(), fd);
+ eDebugCI("CI Slot %d has fd %d", getSlotID(), fd);
state = stateInvalid;
if (fd >= 0)
eDVBCISlot::~eDVBCISlot()
{
+ eDVBCISession::deleteSessions(this);
}
void eDVBCISlot::setAppManager( eDVBCIApplicationManagerSession *session )