[c-host] actually use the 2nd LGMP frame

This commit is contained in:
Geoffrey McRae 2020-01-24 16:06:38 +11:00
parent c7aa8871e4
commit a75b95694b
2 changed files with 3 additions and 7 deletions

View File

@ -1 +1 @@
B1-103-gf9d919bdbb+1
B1-104-gc7aa8871e4+1

View File

@ -107,13 +107,9 @@ static int frameThread(void * opaque)
bool frameValid = false;
bool repeatFrame = false;
int frameIndex = 0;
CaptureFrame frame = { 0 };
const long pageSize = sysinfo_getPageSize();
(void)frameIndex;
(void)repeatFrame;
while(app.running)
{
switch(app.iface->waitFrame(&frame))
@ -164,8 +160,8 @@ static int frameThread(void * opaque)
// we increment the index first so that if we need to repeat a frame
// the index still points to the latest valid frame
if (frameIndex++ == LGMP_Q_FRAME_LEN)
frameIndex = 0;
if (app.frameIndex++ == LGMP_Q_FRAME_LEN)
app.frameIndex = 0;
KVMFRFrame * fi = lgmpHostMemPtr(app.frameMemory[app.frameIndex]);
switch(frame.format)