From 0ad0f796a6b120c2894fa994cbb9ef299a71cbaf Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Tue, 14 Oct 2008 10:59:58 +0000 Subject: [PATCH 1/1] fix incorrect calculated score when loopthrough to a motorized lnb --- lib/dvb/sec.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp index 0f2069c1..f7933d18 100644 --- a/lib/dvb/sec.cpp +++ b/lib/dvb/sec.cpp @@ -128,6 +128,7 @@ eDVBSatelliteEquipmentControl::eDVBSatelliteEquipmentControl(eSmartPtrListis_simulate(); + bool direct_connected = m_not_linked_slot_mask & slot_id; int score=0, satcount=0; if (highest_score_lnb) @@ -153,7 +154,6 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite if ( sit != lnb_param.m_satellites.end()) { bool diseqc=false; - bool direct_connected = m_not_linked_slot_mask & slot_id; long band=0, linked_prev_ptr=-1, linked_next_ptr=-1, @@ -268,12 +268,6 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite eSecDebugNoSimulate("ret4 %d", ret); } - if (ret && rotor && curRotorPos != -1 && direct_connected) { - ret -= abs(curRotorPos-sat.orbital_position); - } - - eSecDebugNoSimulate("ret5 %d", ret); - if (ret) if (satpos_depends_ptr != -1) { @@ -286,9 +280,14 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite if (!rotor || curRotorPos != sat.orbital_position) ret=0; } - eSecDebugNoSimulate("ret6 %d", ret); + eSecDebugNoSimulate("ret5 %d", ret); } + if (ret && rotor && curRotorPos != -1 && (direct_connected || !satpos_depends_ptr) ) // direct conntected or loopthrough! + ret -= abs(curRotorPos-sat.orbital_position); + + eSecDebugNoSimulate("ret6 %d", ret); + if (ret) { int lof = sat.frequency > lnb_param.m_lof_threshold ? @@ -311,7 +310,7 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite } if (score && satcount) score -= (satcount-1); - if (score && m_not_linked_slot_mask & slot_id) + if (score && direct_connected) score += 5; // increase score for tuners with direct sat connection eSecDebugNoSimulate("final score %d", score); return score; -- 2.30.2