Fix video restarting sync issue
There is a video start/stop sync issue inbetween ikvm server and
ikvm manager because newClient and clientGone callbacks are called
by a different thread from libvncserver. To fix this issue, this
commit moves the video.start() call from server to manager to
unify video control thread.
Tested:
Open KVM web page and reload the web page by pressing F5.
KVM page should be reloaded correctly.
Change-Id: Ic0d14ea712510318e9e8f45615a95e82aeaaddf1
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
diff --git a/ikvm_manager.cpp b/ikvm_manager.cpp
index 5e014d0..d56110d 100644
--- a/ikvm_manager.cpp
+++ b/ikvm_manager.cpp
@@ -21,6 +21,7 @@
{
if (server.wantsFrame())
{
+ video.start();
video.getFrame();
server.sendFrame();
}
diff --git a/ikvm_server.cpp b/ikvm_server.cpp
index 37a927b..35310da 100644
--- a/ikvm_server.cpp
+++ b/ikvm_server.cpp
@@ -154,6 +154,7 @@
Server* server = (Server*)cl->screen->screenData;
delete (ClientData*)cl->clientData;
+ cl->clientData = nullptr;
if (server->numClients-- == 1)
{
@@ -173,7 +174,6 @@
{
server->pendingResize = false;
server->frameCounter = 0;
- server->video.start();
}
return RFB_CLIENT_ACCEPT;