mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Performance improvement by avoiding locks in cSatipTuner::ProcessApplicationData().
Don't use malloc, but put variable on stack (=local char array). This avoids a possible lock with other threads, because malloc uses global storage and needs a lock then. Tests eliminated the long lasting processing of RTCP packaged in poller Thread.
This commit is contained in:
parent
52f54d2177
commit
4600a2a070
4
tuner.c
4
tuner.c
@ -262,7 +262,8 @@ void cSatipTuner::ProcessApplicationData(u_char *bufferP, int lengthP)
|
||||
// DVB-C2:
|
||||
// ver=1.2;tuner=<feID>,<level>,<lock>,<quality>,<freq>,<bw>,<msys>,<mtype>,<sr>,<c2tft>,<ds>,<plp>,<specinv>;pids=<pid0>,...,<pidn>
|
||||
if (lengthP > 0) {
|
||||
char *s = strndup((char *)bufferP, lengthP);
|
||||
char s[lengthP];
|
||||
memcpy(s, (char *)bufferP, lengthP);
|
||||
//debug("cSatipTuner::%s(%s) [device %d]", __FUNCTION__, s, deviceIdM);
|
||||
char *c = strstr(s, ";tuner=");
|
||||
if (c) {
|
||||
@ -297,7 +298,6 @@ void cSatipTuner::ProcessApplicationData(u_char *bufferP, int lengthP)
|
||||
// Scale value to 0-100
|
||||
signalQualityM = (hasLockM && (value >= 0)) ? (value * 100 / 15) : 0;
|
||||
}
|
||||
free(s);
|
||||
}
|
||||
reConnectM.Set(eConnectTimeoutMs);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user