fix: wait half a second, not half a millisecond, for a vnc update

This commit is contained in:
singhharsh1708 committed 2026-11-19 00:21:24 +05:30
1 parent 45808c7e0e
commit 8dfd8e52f2
1 file changed
+7 -2
+7 -2
View File
@@ -1,6 +1,7 @@
#include "zm_libvnc_camera.h"
#include "zm_packet.h"
#include "zm_signal.h"
#include <dlfcn.h>
#if HAVE_LIBVNC
@@ -203,9 +204,13 @@ int VncCamera::PrimeCapture() {
}
int VncCamera::PreCapture() {
int rc = (*WaitForMessage_f)(mRfb, 500);
// The timeout is in microseconds: wait up to half a second for an update.
int rc = (*WaitForMessage_f)(mRfb, 500000);
// Any handled signal (stop, reload, or the logger's WINCH/USR1/USR2) interrupts
// the wait; poll once more so only a real socket error is a failure.
if (rc < 0 and !zm_terminate and !zm_reload) rc = (*WaitForMessage_f)(mRfb, 0);
if (rc < 0) {
return -1;
return (zm_terminate or zm_reload) ? 0 : -1;
} else if (!rc) {
return rc;
}