remove the extra call to version

This commit is contained in:
onyx-and-iris 2024-07-02 14:49:42 +01:00
parent 4b79b7f849
commit f8d2f80cbf

View File

@ -30,25 +30,25 @@ long login(T_VBVMR_INTERFACE *vmr, int kind)
log_info( log_info(
"Launching Voicemeeter %s GUI", "Launching Voicemeeter %s GUI",
kind_as_string(kind_s, kind, KIND_STR_LEN)); kind_as_string(kind_s, kind, KIND_STR_LEN));
time_t endwait;
int timeout = 2;
endwait = time(NULL) + timeout;
do
{
if ((rep = version(vmr, &v)) == 0)
break;
Sleep(50);
} while (time(NULL) < endwait);
} }
int timeout = 2;
time_t start = time(NULL);
do
{
if ((rep = version(vmr, &v)) == 0)
{
char version_s[VERSION_STR_LEN];
log_info(
"Successfully logged into the Voicemeeter API v%s",
version_as_string(version_s, v, VERSION_STR_LEN));
break;
}
Sleep(50);
} while (time(NULL) < start + timeout);
if (rep == 0) if (rep == 0)
{ {
version(vmr, &v);
char version_s[VERSION_STR_LEN];
log_info(
"Successfully logged into the Voicemeeter API v%s",
version_as_string(version_s, v, VERSION_STR_LEN));
clear_dirty(vmr); clear_dirty(vmr);
} }
return rep; return rep;