Ich bin jetzt hergegangen und habe die ganze Methode durch das ersetzt:
void cGraphTFTDisplay::Action() {
int wait = timeMs.Elapsed(), elapsed;
// give the plugin time to collect some data AND give vdr some time to
// finish initialization before acquiring the lock
usleep(500000);
_active = true;
_mutex.Lock(); // mutex gets ONLY unlocked when sleeping
while (_active) {
d(4, "updating display\n");
// milliseconds elapsed since last update
elapsed = timeMs.Elapsed() - wait;
// check for volumebar
if (_volumeIn < 0)
_volumeIn *= -1;
else if (_volumeIn > 0)
_volumeIn -= elapsed;
// check for osdmessage
if (_messageIn < 0)
_messageIn *= -1;
else if (_messageIn > 0)
_messageIn -= elapsed;
// check for animation
if (_animation && _frameIn > 0)
_frameIn -= elapsed;
// check if there is another recording to show
if (_recordings.size() > 1) {
if (_recordingIn < 0)
_recordingIn *= -1;
else {
_recordingIn -= elapsed;
if (_recordingIn <= 0) {
_showRecording = (_showRecording + 1) % _recordings.size();
_recordingIn = SECONDS(5);
}
}
}
// here do the update
wait = timeMs.Elapsed();
switch (_mode) {
case NormalTV:
Display(sectionNormalTV);
break;
case NormalRadio:
Display(sectionNormalRadio);
break;
case ReplayNormal:
Display(sectionReplayNormal);
break;
case ReplayMP3:
Display(sectionReplayMP3);
break;
case ReplayDVD:
Display(sectionReplayDVD);
break;
case OsdMenu:
Display(sectionMenu);
break;
default:
break;
}
elapsed = timeMs.Elapsed() - wait;
d(4, "update took %d ms\n", elapsed);
// next update in...?
_updateIn = SECONDS(60); // one minute
if (_mode & ReplayMask)
_updateIn = SECONDS(1) - elapsed; // one second minus update time
else if (_recordings.size() > 1)
_updateIn = _recordingIn; // use time calculated above
else {
if( _marquee_active == false ){
_marquee_active = true;
}
}
// possibly updating osdmessage
if (_messageIn > 0 && _messageIn < _updateIn)
_updateIn = _messageIn;
// possibly updating volume bar
if (_volumeIn > 0 && _volumeIn < _updateIn)
_updateIn = _volumeIn;
// possibly animating
if (_animation && _mode != OsdMenu) {
_frameIn -= elapsed;
if (_frameIn < 0)
_updateIn = 0;
else if (_frameIn < _updateIn)
_updateIn = _frameIn;
}
if (_updateIn < 100)
_updateIn = 100;
// wait for event or timeout
wait = timeMs.Elapsed();
_doUpdate.TimedWait(_mutex, _updateIn);
_updateIn = 100 - (timeMs.Elapsed() - wait);
while (_updateIn > 0) {
_doUpdate.TimedWait(_mutex, _updateIn);
_updateIn = 100 - (timeMs.Elapsed() - wait);
}
while (_delayIn > 0) { // a delayed update was requested
int delay = _delayIn;
d(5, "delayed update in max. %d ms\n", _delayIn);
_delayIn = 0;
_doUpdate.TimedWait(_mutex, delay);
}
}
}
Alles anzeigen
Keine Ahnung, ob sich das auf das Scrolling von Text auswirkt, das geht bei mir eh nicht, oder ich habe es nicht an, keine Ahnung. Die Änderung bewirkt jedenfalls u.a., dass eine Mindestwartezeit von 100 ms zwischen den Aktualisierungen eingeführt wird. Öfter will ich das Bild eh nicht sehen.
Das ganze Plugin ist mir sowieso etwas suspekt, weil ich letztens versucht habe, ein Theme anzupassen, aber aufgrund der ganzen Schreibfehler den Durchblick verlor. Da stehen solche Sachen wie "widht" drin. Nach einem Blick in den Quellcode habe ich dann mitbekommen, dass die im Theme tatsächlich prämeditiert waren... aber dann hatte ich keine Böcke mehr.