fix bluescreen in ci menu when no entries in a menulist an ok is pressed
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 22 May 2006 15:21:41 +0000 (15:21 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 22 May 2006 15:21:41 +0000 (15:21 +0000)
reset CI when opening CI Menu and ci is not initialized yet

lib/dvb_ci/dvbci.cpp
lib/dvb_ci/dvbci.h
lib/dvb_ci/dvbci_ui.cpp
lib/python/Screens/Ci.py

index 6f532be..b182a36 100644 (file)
@@ -66,6 +66,16 @@ eDVBCISlot *eDVBCIInterfaces::getSlot(int slotid)
        return 0;
 }
 
        return 0;
 }
 
+int eDVBCIInterfaces::getSlotState(int slotid)
+{
+       eDVBCISlot *slot;
+
+       if( (slot = getSlot(slotid)) == 0 )
+               return eDVBCISlot::stateInvalid;
+
+       return slot->getState();
+}
+
 int eDVBCIInterfaces::reset(int slotid)
 {
        eDVBCISlot *slot;
 int eDVBCIInterfaces::reset(int slotid)
 {
        eDVBCISlot *slot;
index 2ef70b0..7605a6d 100644 (file)
@@ -114,6 +114,7 @@ public:
        void recheckPMTHandlers();
        void gotPMT(eDVBServicePMTHandler *pmthandler);
        void ciRemoved(eDVBCISlot *slot);
        void recheckPMTHandlers();
        void gotPMT(eDVBServicePMTHandler *pmthandler);
        void ciRemoved(eDVBCISlot *slot);
+       int getSlotState(int slot);
 
        static eDVBCIInterfaces *getInstance();
        
 
        static eDVBCIInterfaces *getInstance();
        
index ddb42fd..2391145 100644 (file)
@@ -43,7 +43,11 @@ eDVBCI_UI *eDVBCI_UI::getInstance()
 int eDVBCI_UI::getState(int slot)
 {
        if (slot < MAX_SLOTS)
 int eDVBCI_UI::getState(int slot)
 {
        if (slot < MAX_SLOTS)
+       {
+               if (eDVBCIInterfaces::getInstance()->getSlotState(slot) == eDVBCISlot::stateInvalid)
+                       eDVBCIInterfaces::getInstance()->reset(slot);
                return slotdata[slot].state;
                return slotdata[slot].state;
+       }
        return 0;
 }
 
        return 0;
 }
 
index a32ce34..ecc5604 100644 (file)
@@ -89,7 +89,11 @@ class CiMmi(Screen):
                        print "do nothing - wait"
                elif self.tag == "MENU":
                        print "answer MENU"
                        print "do nothing - wait"
                elif self.tag == "MENU":
                        print "answer MENU"
-                       eDVBCI_UI.getInstance().answerMenu(self.slotid, self["entries"].getCurrent()[1])
+                       cur = self["entries"].getCurrent()
+                       if cur:
+                               eDVBCI_UI.getInstance().answerMenu(self.slotid, cur[1])
+                       else:
+                               eDVBCI_UI.getInstance().answerMenu(self.slotid, 0)
                        self.showWait() 
                elif self.tag == "LIST":
                        print "answer LIST"
                        self.showWait() 
                elif self.tag == "LIST":
                        print "answer LIST"