mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-05-26 23:36:16 +00:00
refactoring
This commit is contained in:
@@ -150,12 +150,12 @@ static int _wait_frame(int fd, memsink_shared_s* mem, uint64_t last_id) {
|
|||||||
long double deadline_ts = get_now_monotonic() + _g_wait_timeout;
|
long double deadline_ts = get_now_monotonic() + _g_wait_timeout;
|
||||||
long double now;
|
long double now;
|
||||||
do {
|
do {
|
||||||
int retval = flock_timedwait_monotonic(fd, _g_lock_timeout);
|
int result = flock_timedwait_monotonic(fd, _g_lock_timeout);
|
||||||
now = get_now_monotonic();
|
now = get_now_monotonic();
|
||||||
if (retval < 0 && errno != EWOULDBLOCK) {
|
if (result < 0 && errno != EWOULDBLOCK) {
|
||||||
JLOG_PERROR("video", "Can't lock memsink");
|
JLOG_PERROR("video", "Can't lock memsink");
|
||||||
return -1;
|
return -1;
|
||||||
} else if (retval == 0) {
|
} else if (result == 0) {
|
||||||
if (mem->magic == MEMSINK_MAGIC && mem->version == MEMSINK_VERSION && mem->id != last_id) {
|
if (mem->magic == MEMSINK_MAGIC && mem->version == MEMSINK_VERSION && mem->id != last_id) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user