do..while, sleep before first call to version()

This commit is contained in:
onyx-and-iris 2024-06-27 03:31:26 +01:00
parent 06df144374
commit 7db10650fb

View File

@ -10,7 +10,6 @@ long login(T_VBVMR_INTERFACE *iVMR, int kind)
long v; long v;
rep = iVMR->VBVMR_Login(); rep = iVMR->VBVMR_Login();
Sleep(20);
if (rep == 1) if (rep == 1)
{ {
run_voicemeeter(iVMR, kind); run_voicemeeter(iVMR, kind);
@ -34,12 +33,12 @@ long login(T_VBVMR_INTERFACE *iVMR, int kind)
int timeout = 2; int timeout = 2;
endwait = time(NULL) + timeout; endwait = time(NULL) + timeout;
while (time(NULL) < endwait) do
{ {
Sleep(100);
if ((rep = version(iVMR, &v)) == 0) if ((rep = version(iVMR, &v)) == 0)
break; break;
Sleep(20); } while (time(NULL) < endwait);
}
} }
if (rep == 0) if (rep == 0)
{ {