mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 11:17:54 +00:00
[obs] microsttuer fix, be sure to always grab the latest frame
This commit is contained in:
parent
1d6d640b6e
commit
3511fb8d59
2 changed files with 15 additions and 1 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
B2-rc2-23-g977d7b277d+1
|
||||
B2-rc2-24-g1d6d640b6e+1
|
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 a new issue