]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Fix traffic management in playback tests
authorPierre Ossman <ossman@cendio.se>
Thu, 1 Jun 2017 10:50:00 +0000 (12:50 +0200)
committerPierre Ossman <ossman@cendio.se>
Thu, 1 Jun 2017 10:50:00 +0000 (12:50 +0200)
tests/playback.js

index b39c9818f079dec9a18588aa8483fa3571545029..745e1f55c5c2bbd25de1cc1503441209b63fa971 100644 (file)
@@ -152,11 +152,12 @@ RecordingPlayer.prototype = {
 
     _doPacket: function () {
         // Avoid having excessive queue buildup in non-realtime mode
-        if (!this._trafficManagement && this._rfb._flushing) {
+        if (this._trafficManagement && this._rfb._flushing) {
             let player = this;
-            this._rfb.display.set_onFlush(function () {
-                this._rfb._display.set_onFlush(this._rfb._onFlush.bind(this._rfb));
-                this._rfb._onFlush();
+            let orig = this._rfb._display.get_onFlush();
+            this._rfb._display.set_onFlush(function () {
+                player._rfb._display.set_onFlush(orig);
+                player._rfb._onFlush();
                 player._doPacket();
             });
             return;