Added the possibility to interrupt delay between the buffer updates.
It is useful when stop, close or quit is performing.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@234 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/rfbplayer/FbsInputStream.cxx b/rfbplayer/FbsInputStream.cxx
index 4b5da6f..a173beb 100644
--- a/rfbplayer/FbsInputStream.cxx
+++ b/rfbplayer/FbsInputStream.cxx
@@ -36,6 +36,8 @@
seekBackwards = false;
paused = false;
+ interruptDelay = false;
+
fbsFile = fopen(FileName, "rb");
if (fbsFile == NULL) {
char *msg = new char[12 + sizeof(FileName)];
@@ -142,14 +144,15 @@
}
}
- while (true) {
+ while (!interruptDelay) {
long timeDiff = startTime + timeOffset - GetTickCount();
if (timeDiff <= 0) {
break;
}
- Sleep(timeDiff);
+ Sleep(min(20, timeDiff));
waitWhilePaused();
}
+ interruptDelay = false;
return nItems;
}
@@ -192,6 +195,10 @@
}
}
+void FbsInputStream::interruptFrameDelay() {
+ interruptDelay = true;
+}
+
//
// Methods providing additional functionality.
//