diff --git a/c-host/app.c b/c-host/app.c index 359e0a39..fcee9205 100644 --- a/c-host/app.c +++ b/c-host/app.c @@ -71,8 +71,8 @@ static int pointerThread(void * opaque) pointer->data = app.pointerData; if (!app.iface->getPointer(&pointer)) DEBUG_ERROR("Failed to get the pointer"); - os_signalEvent(app.updateEvent); #endif + os_signalEvent(app.updateEvent); } DEBUG_INFO("Cursor thread stopped"); @@ -303,6 +303,7 @@ int app_main() bool frameUpdate = false; bool pointerUpdate = false; +retry_capture: switch(iface->capture(&frameUpdate, &pointerUpdate)) { case CAPTURE_RESULT_OK: @@ -342,6 +343,9 @@ int app_main() goto finish; } + if (!frameUpdate && !pointerUpdate) + goto retry_capture; + if (frameUpdate && !os_signalEvent(app.frameEvent)) { DEBUG_ERROR("Failed to signal the frame thread");