[host] app: cleanup local variables during init.

This commit is contained in:
Geoffrey McRae 2023-10-21 22:03:22 +11:00
parent 6b65c7e339
commit ad65561511

View File

@ -815,6 +815,7 @@ int app_main(int argc, char * argv[])
int throttleUs = throttleFps ? 1000000 / throttleFps : 0;
uint64_t previousFrameTime = 0;
{
const char * ifaceName = option_get_string("app", "capture");
CaptureInterface * iface = NULL;
for(int i = 0; CaptureInterfaces[i]; ++i)
@ -853,6 +854,7 @@ int app_main(int argc, char * argv[])
"Asynchronous" : "Synchronous");
app.iface = iface;
}
if (!lgmpSetup(&shmDev))
{
@ -928,14 +930,14 @@ int app_main(int argc, char * argv[])
}
const uint64_t captureStart = microtime();
switch(iface->capture())
switch(app.iface->capture())
{
case CAPTURE_RESULT_OK:
previousFrameTime = captureStart;
break;
case CAPTURE_RESULT_TIMEOUT:
if (!iface->asyncCapture)
if (!app.iface->asyncCapture)
if (app.frameValid && lgmpHostQueueNewSubs(app.frameQueue) > 0)
{
LGMP_STATUS status;
@ -956,7 +958,7 @@ int app_main(int argc, char * argv[])
goto fail_capture;
}
if (!iface->asyncCapture)
if (!app.iface->asyncCapture)
sendFrame();
}
@ -987,7 +989,7 @@ fail_threads:
captureStop();
fail_capture:
iface->free();
app.iface->free();
LG_LOCK_FREE(app.pointerLock);
fail_lgmp: