summaryrefslogtreecommitdiffstats
path: root/x11vnc/x11vnc.c
diff options
context:
space:
mode:
authorrunge <runge>2008-06-01 21:13:35 +0000
committerrunge <runge>2008-06-01 21:13:35 +0000
commitc63fd348444c812d27a9472d308942f6accbdf91 (patch)
tree7361cdb9574bd1e1e83cfe3948dae4e5992c8e7a /x11vnc/x11vnc.c
parent65b42bb85354cce814316a646a4a5ed6025a18e3 (diff)
downloadlibtdevnc-c63fd348444c812d27a9472d308942f6accbdf91.tar.gz
libtdevnc-c63fd348444c812d27a9472d308942f6accbdf91.zip
x11vnc: lower waitms and defer if framebuffer reads are fast (> 100MB/s)
Diffstat (limited to 'x11vnc/x11vnc.c')
-rw-r--r--x11vnc/x11vnc.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/x11vnc/x11vnc.c b/x11vnc/x11vnc.c
index e8c04fe..af001ea 100644
--- a/x11vnc/x11vnc.c
+++ b/x11vnc/x11vnc.c
@@ -3222,6 +3222,7 @@ int main(int argc, char* argv[]) {
} else if (!strcmp(arg, "-wait")) {
CHECK_ARGC
waitms = atoi(argv[++i]);
+ got_waitms = 1;
} else if (!strcmp(arg, "-wait_ui")) {
CHECK_ARGC
wait_ui = atof(argv[++i]);
@@ -4782,6 +4783,28 @@ if (0) fprintf(stderr, "XA: %s\n", getenv("XAUTHORITY"));
initialize_speeds();
+ if (speeds_read_rate_measured > 100) {
+ /* framebuffer read is fast at > 100 MB/sec */
+ if (! got_waitms) {
+ waitms /= 2;
+ if (waitms < 10) {
+ waitms = 10;
+ }
+ if (!quiet) {
+ rfbLog("fast read: reset wait ms to: %d\n", waitms);
+ }
+ }
+ if (! got_deferupdate && ! got_defer) {
+ if (defer_update > 15) {
+ defer_update = 15;
+ if (screen) {
+ screen->deferUpdateTime = defer_update;
+ }
+ rfbLog("fast read: reset defer ms to: %d\n", defer_update);
+ }
+ }
+ }
+
initialize_keyboard_and_pointer();
if (inetd && use_openssl) {