Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/arvgvfakecamera.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ _thread (void *user_data)
do {
gint timeout_ms;

timeout_ms = (next_timestamp_us - g_get_real_time ()) / 1000LL;
/* Signed arithmetic: if next_timestamp_us is already in the past, an
* unsigned subtraction underflows and is clamped to a spurious 100 ms
* timeout, stalling the frame pacing. */
timeout_ms = ((gint64) next_timestamp_us - g_get_real_time ()) / 1000LL;
if (timeout_ms < 0)
timeout_ms = 0;
else if (timeout_ms > 100)
Expand Down