mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Clamp signal quality and level values.
This commit is contained in:
parent
2f11ad7a98
commit
21261f8042
4
tuner.c
4
tuner.c
@ -292,7 +292,7 @@ void cSatipTuner::ProcessApplicationData(u_char *bufferP, int lengthP)
|
|||||||
// -65dBm corresponds to 32
|
// -65dBm corresponds to 32
|
||||||
// No signal corresponds to 0
|
// No signal corresponds to 0
|
||||||
c = strstr(c, ",");
|
c = strstr(c, ",");
|
||||||
value = atoi(++c);
|
value = min(atoi(++c), 255);
|
||||||
// Scale value to 0-100
|
// Scale value to 0-100
|
||||||
signalStrengthM = (value >= 0) ? (value * 100 / 255) : -1;
|
signalStrengthM = (value >= 0) ? (value * 100 / 255) : -1;
|
||||||
|
|
||||||
@ -310,7 +310,7 @@ void cSatipTuner::ProcessApplicationData(u_char *bufferP, int lengthP)
|
|||||||
// -a BER lower than 2x10-4 after Viterbi for DVB-S
|
// -a BER lower than 2x10-4 after Viterbi for DVB-S
|
||||||
// -a PER lower than 10-7 for DVB-S2
|
// -a PER lower than 10-7 for DVB-S2
|
||||||
c = strstr(c, ",");
|
c = strstr(c, ",");
|
||||||
value = atoi(++c);
|
value = min(atoi(++c), 15);
|
||||||
// Scale value to 0-100
|
// Scale value to 0-100
|
||||||
signalQualityM = (hasLockM && (value >= 0)) ? (value * 100 / 15) : 0;
|
signalQualityM = (hasLockM && (value >= 0)) ? (value * 100 / 15) : 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user