Fix traffic management in playback tests

This commit is contained in:
Pierre Ossman 2017-06-01 12:50:00 +02:00
parent 39193b2878
commit 255fbe0c9e
1 changed files with 5 additions and 4 deletions

View File

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