From 7db10650fbb413d7be26f5e385b0c8e54d74643f Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Thu, 27 Jun 2024 03:31:26 +0100 Subject: [PATCH] do..while, sleep before first call to version() --- src/vmr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/vmr.c b/src/vmr.c index c029ea6..d25131a 100644 --- a/src/vmr.c +++ b/src/vmr.c @@ -10,7 +10,6 @@ long login(T_VBVMR_INTERFACE *iVMR, int kind) long v; rep = iVMR->VBVMR_Login(); - Sleep(20); if (rep == 1) { run_voicemeeter(iVMR, kind); @@ -34,12 +33,12 @@ long login(T_VBVMR_INTERFACE *iVMR, int kind) int timeout = 2; endwait = time(NULL) + timeout; - while (time(NULL) < endwait) + do { + Sleep(100); if ((rep = version(iVMR, &v)) == 0) break; - Sleep(20); - } + } while (time(NULL) < endwait); } if (rep == 0) {