mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 22:31:46 +00:00
[client] main: skip duplicate frames
When a new client connects to our session the host will repeat the last valid frame for the new client. This change will detect this and skip the duplicated frame.
This commit is contained in:
parent
b39f38350f
commit
9dffde74b2
1 changed files with 13 additions and 2 deletions
|
@ -424,8 +424,9 @@ int main_frameThread(void * unused)
|
||||||
LGMP_STATUS status;
|
LGMP_STATUS status;
|
||||||
PLGMPClientQueue queue;
|
PLGMPClientQueue queue;
|
||||||
|
|
||||||
uint32_t formatVer = 0;
|
uint32_t frameSerial = 0;
|
||||||
size_t dataSize = 0;
|
uint32_t formatVer = 0;
|
||||||
|
size_t dataSize = 0;
|
||||||
LG_RendererFormat lgrFormat;
|
LG_RendererFormat lgrFormat;
|
||||||
|
|
||||||
struct DMAFrameInfo dmaInfo[LGMP_Q_FRAME_LEN] = {0};
|
struct DMAFrameInfo dmaInfo[LGMP_Q_FRAME_LEN] = {0};
|
||||||
|
@ -495,6 +496,16 @@ int main_frameThread(void * unused)
|
||||||
}
|
}
|
||||||
|
|
||||||
KVMFRFrame * frame = (KVMFRFrame *)msg.mem;
|
KVMFRFrame * frame = (KVMFRFrame *)msg.mem;
|
||||||
|
|
||||||
|
// ignore any repeated frames, this happens when a new client connects to
|
||||||
|
// the same host application.
|
||||||
|
if (frame->frameSerial == frameSerial)
|
||||||
|
{
|
||||||
|
lgmpClientMessageDone(queue);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
frameSerial = frame->frameSerial;
|
||||||
|
|
||||||
struct DMAFrameInfo *dma = NULL;
|
struct DMAFrameInfo *dma = NULL;
|
||||||
|
|
||||||
if (!g_state.formatValid || frame->formatVer != formatVer)
|
if (!g_state.formatValid || frame->formatVer != formatVer)
|
||||||
|
|
Loading…
Reference in a new issue