fix calculation in calculateDifference for cable and terrestrial which should complet...
[enigma2.git] / lib / dvb / frontend.cpp
index 1067a01..c8434c0 100644 (file)
@@ -195,7 +195,22 @@ RESULT eDVBFrontendParameters::calculateDifference(const iDVBFrontendParameters
                return 0;
        }
        case iDVBFrontend::feCable:
+               eDVBFrontendParametersCable ocable;
+               if (parm->getDVBC(ocable))
+                       return -2;
+               
+               diff = abs(cable.frequency - ocable.frequency);
+               diff += abs(cable.symbol_rate - ocable.symbol_rate);
+               
+               return 0;
        case iDVBFrontend::feTerrestrial:
+               eDVBFrontendParametersTerrestrial oterrestrial;
+               if (parm->getDVBT(oterrestrial))
+                       return -2;
+               
+               diff = abs(terrestrial.frequency - oterrestrial.frequency);
+
+               return 0;
        default:
                return -1;
        }