fix tuner device mapping in case tuners are not starting as first device (e.g. NetCeiver mcli)

This commit is contained in:
Peter Bieringer 2021-03-11 09:32:09 +01:00 committed by kamel5
parent cbce894c0c
commit 4d3fa0bc71

View File

@ -306,7 +306,15 @@ bool cVeDevices::Parse(bool forced) {
if (recDevice) { if (recDevice) {
mutexDevices.Lock(); mutexDevices.Lock();
if (recDevices) if (recDevices)
recDevices[recDevice->DeviceNumber()] = true; {
int d = recDevice->DeviceNumber();
for (int i = 0; i < numDevices; i++) {
if (devices[i] == d) {
recDevices[i] = true;
break;
}
}
}
mutexDevices.Unlock(); mutexDevices.Unlock();
} }
} }
@ -347,7 +355,7 @@ bool cVeDevices::Parse(bool forced) {
} }
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::signalstrength, *cString::sprintf("%d", signalStrength)); tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::signalstrength, *cString::sprintf("%d", signalStrength));
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::signalquality, *cString::sprintf("%d", signalQuality)); tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::signalquality, *cString::sprintf("%d", signalQuality));
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::livetv, i == deviceLiveTV ? "1" : "0"); tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::livetv, devices[i] == deviceLiveTV ? "1" : "0");
bool isRecording = false; bool isRecording = false;
mutexDevices.Lock(); mutexDevices.Lock();