mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 15:58:31 +00:00
fixed crash in drawing devices
This commit is contained in:
@@ -21,7 +21,7 @@ cViewHelpers::~cViewHelpers() {
|
||||
}
|
||||
|
||||
void cViewHelpers::InitDevices(void) {
|
||||
int numDevices = cDevice::NumDevices();
|
||||
numDevices = cDevice::NumDevices();
|
||||
lastSignalStrength = new int[numDevices];
|
||||
lastSignalQuality = new int[numDevices];
|
||||
recDevices = new bool[numDevices];
|
||||
@@ -34,9 +34,6 @@ void cViewHelpers::InitDevices(void) {
|
||||
}
|
||||
|
||||
bool cViewHelpers::SetDevices(bool initial, map<string,int> *intTokens, vector<map<string,string> > *devices) {
|
||||
#ifdef DOPROFILE
|
||||
cStopWatch watch("SetDevices");
|
||||
#endif
|
||||
if (!initial) {
|
||||
//check if drawing is necessary
|
||||
bool changed = false;
|
||||
@@ -46,23 +43,13 @@ bool cViewHelpers::SetDevices(bool initial, map<string,int> *intTokens, vector<m
|
||||
continue;
|
||||
}
|
||||
int signalStrength = device->SignalStrength();
|
||||
#ifdef DOPROFILE
|
||||
watch.Report(*cString::sprintf("SignalStrength() device %d", i));
|
||||
#endif
|
||||
int signalQuality = device->SignalQuality();
|
||||
#ifdef DOPROFILE
|
||||
watch.Report(*cString::sprintf("SignalQuality() device %d", i));
|
||||
#endif
|
||||
|
||||
if ((signalStrength != lastSignalStrength[i]) || (signalQuality != lastSignalQuality[i])) {
|
||||
changed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!changed) {
|
||||
#ifdef DOPROFILE
|
||||
watch.Stop("SetDevices End");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -109,13 +96,7 @@ bool cViewHelpers::SetDevices(bool initial, map<string,int> *intTokens, vector<m
|
||||
deviceVals.insert(pair< string, string >("devices[hascam]", "0"));
|
||||
}
|
||||
int signalStrength = device->SignalStrength();
|
||||
#ifdef DOPROFILE
|
||||
watch.Report(*cString::sprintf("SignalStrength() device %d", i));
|
||||
#endif
|
||||
int signalQuality = device->SignalQuality();
|
||||
#ifdef DOPROFILE
|
||||
watch.Report(*cString::sprintf("SignalQuality() device %d", i));
|
||||
#endif
|
||||
stringstream strCamNumber;
|
||||
strCamNumber << camNumber;
|
||||
deviceVals.insert(pair< string, string >("devices[cam]", strCamNumber.str()));
|
||||
@@ -157,9 +138,6 @@ bool cViewHelpers::SetDevices(bool initial, map<string,int> *intTokens, vector<m
|
||||
}
|
||||
|
||||
intTokens->insert(pair<string, int>("numdevices", actualNumDevices));
|
||||
#ifdef DOPROFILE
|
||||
watch.Stop("SetDevices End");
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user