Merge branch 'bug_461_play_another_timeshift_file_after_eof' into experimental
[enigma2.git] / lib / dvb / sec.cpp
index c06c603addad45581be4004b34e31827ec4b95e0..8b6bc49197a5920c1910af868fa139f48c4ba4ad 100644 (file)
@@ -37,7 +37,7 @@ void eDVBSatelliteEquipmentControl::setParam(int param, int value)
 }
 
 eDVBSatelliteEquipmentControl::eDVBSatelliteEquipmentControl(eSmartPtrList<eDVBRegisteredFrontend> &avail_frontends, eSmartPtrList<eDVBRegisteredFrontend> &avail_simulate_frontends)
-       :m_lnbidx((sizeof(m_lnbs) / sizeof(eDVBSatelliteLNBParameters))-1), m_curSat(m_lnbs[0].m_satellites.end()), m_avail_frontends(avail_frontends), m_avail_simulate_frontends(avail_simulate_frontends), m_rotorMoving(false)
+       :m_lnbidx((sizeof(m_lnbs) / sizeof(eDVBSatelliteLNBParameters))-1), m_curSat(m_lnbs[0].m_satellites.end()), m_avail_frontends(avail_frontends), m_avail_simulate_frontends(avail_simulate_frontends), m_rotorMoving(0)
 {
        if (!instance)
                instance = this;
@@ -156,6 +156,11 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
                                        ret = 15000;
                                }
 
+                               if (sat.no_rotor_command_on_tune && !rotor) {
+                                       eSecDebugNoSimulate("no rotor but no_rotor_command_on_tune is set.. ignore lnb %d", idx);
+                                       continue;
+                               }
+
                                eSecDebugNoSimulate("ret1 %d", ret);
 
                                if (linked_in_use)
@@ -170,21 +175,6 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
                                        else
                                                ret += 15;
                                        eSecDebugNoSimulate("ret2 %d", ret);
-                                       if (ret) // special case when this tuner is linked to a satpos dependent tuner
-                                       {
-                                               fe->getData(eDVBFrontend::SATPOS_DEPENDS_PTR, satpos_depends_ptr);
-                                               if (satpos_depends_ptr != -1)
-                                               {
-                                                       eDVBRegisteredFrontend *satpos_depends_to_fe = (eDVBRegisteredFrontend*) satpos_depends_ptr;
-                                                       satpos_depends_to_fe->m_frontend->getData(eDVBFrontend::ROTOR_POS, rotor_pos);
-                                                       if (!rotor || rotor_pos == -1 /* we dont know the rotor position yet */
-                                                               || rotor_pos != sat.orbital_position ) // not the same orbital position?
-                                                       {
-                                                               ret = 0;
-                                                       }
-                                               }
-                                       }
-                                       eSecDebugNoSimulate("ret3 %d", ret);
                                }
                                else if (satpos_depends_ptr != -1)
                                {
@@ -210,8 +200,12 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
                                                        ret = 0;
                                                }
                                        }
-                                       eSecDebugNoSimulate("ret4 %d", ret);
+                                       eSecDebugNoSimulate("ret3 %d", ret);
                                }
+                               else if (!direct_connected)
+                                       ret = 0;
+
+                               eSecDebugNoSimulate("ret4 %d", ret);
 
                                if (ret && rotor && rotor_pos != -1)
                                        ret -= abs(rotor_pos-sat.orbital_position);
@@ -1481,7 +1475,10 @@ bool eDVBSatelliteEquipmentControl::isRotorMoving()
        return m_rotorMoving;
 }
 
-void eDVBSatelliteEquipmentControl::setRotorMoving(bool b)
+void eDVBSatelliteEquipmentControl::setRotorMoving(int slot_no, bool b)
 {
-       m_rotorMoving=b;
+       if (b)
+               m_rotorMoving |= (1 << slot_no);
+       else
+               m_rotorMoving &= ~(1 << slot_no);
 }