mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[obs] microsttuer fix, be sure to always grab the latest frame
This commit is contained in:
parent
1d6d640b6e
commit
3511fb8d59
14
obs/lg.c
14
obs/lg.c
@ -1,3 +1,5 @@
|
||||
#define _GNU_SOURCE //needed for pthread_setname_np
|
||||
|
||||
#include <obs/obs-module.h>
|
||||
#include <obs/util/threading.h>
|
||||
|
||||
@ -193,6 +195,7 @@ static void lgUpdate(void * data, obs_data_t * settings)
|
||||
|
||||
this->state = STATE_STARTING;
|
||||
pthread_create(&this->frameThread, NULL, frameThread, this);
|
||||
pthread_setname_np(this->frameThread, "LGFrameThread");
|
||||
}
|
||||
|
||||
static void lgVideoTick(void * data, float seconds)
|
||||
@ -212,6 +215,17 @@ static void lgVideoTick(void * data, float seconds)
|
||||
return;
|
||||
}
|
||||
|
||||
if ((status = lgmpClientAdvanceToLast(this->frameQueue)) != LGMP_OK)
|
||||
{
|
||||
if (status != LGMP_ERR_QUEUE_EMPTY)
|
||||
{
|
||||
os_sem_post(this->frameSem);
|
||||
printf("lgmpClientAdvanceToLast: %s\n", lgmpStatusString(status));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((status = lgmpClientProcess(this->frameQueue, &msg)) != LGMP_OK)
|
||||
{
|
||||
if (status == LGMP_ERR_QUEUE_EMPTY)
|
||||
|
Loading…
Reference in New Issue
Block a user