mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-27 23:19:02 +08:00
quality monitor, delay displays as 0 when fps is 0 (#8441)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
parent
1a21dff5d4
commit
3742b51d58
@ -498,8 +498,10 @@ class QualityMonitor extends StatelessWidget {
|
||||
children: [
|
||||
_row("Speed", qualityMonitorModel.data.speed ?? '-'),
|
||||
_row("FPS", qualityMonitorModel.data.fps ?? '-'),
|
||||
// let delay be 0 if fps is 0
|
||||
_row(
|
||||
"Delay", "${qualityMonitorModel.data.delay ?? '-'}ms",
|
||||
"Delay",
|
||||
"${qualityMonitorModel.data.delay == null ? '-' : (qualityMonitorModel.data.fps ?? "").replaceAll(' ', '').replaceAll('0', '').isEmpty ? 0 : qualityMonitorModel.data.delay}ms",
|
||||
rightColor: Colors.green),
|
||||
_row("Target Bitrate",
|
||||
"${qualityMonitorModel.data.targetBitrate ?? '-'}kb"),
|
||||
|
@ -519,12 +519,12 @@ class QualityMonitor: Reactor.Component
|
||||
|
||||
$(#quality-monitor).content(<QualityMonitor />);
|
||||
handler.updateQualityStatus = function(speed, fps, delay, bitrate, codec_format, chroma) {
|
||||
speed ? qualityMonitorData[0] = speed:null;
|
||||
fps ? qualityMonitorData[1] = fps:null;
|
||||
delay ? qualityMonitorData[2] = delay:null;
|
||||
bitrate ? qualityMonitorData[3] = bitrate:null;
|
||||
codec_format ? qualityMonitorData[4] = codec_format:null;
|
||||
chroma ? qualityMonitorData[5] = chroma:null;
|
||||
if (speed !== null) qualityMonitorData[0] = speed;
|
||||
if (fps !== null) qualityMonitorData[1] = fps;
|
||||
if (delay !== null) qualityMonitorData[2] = qualityMonitorData[1] === 0 ? 0 : delay;
|
||||
if (bitrate !== null) qualityMonitorData[3] = bitrate;
|
||||
if (codec_format !== null) qualityMonitorData[4] = codec_format;
|
||||
if (chroma !== null) qualityMonitorData[5] = chroma;
|
||||
qualityMonitor.update();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user