From 5a432144018ba3df6125b1956756a84c09f42c17 Mon Sep 17 00:00:00 2001 From: Michael Adams Date: Sat, 19 Feb 2022 08:15:31 -0800 Subject: [PATCH 6/6] Applied the following patch from OpenSUSE: xv-3.10a-ticks.dif --- src/xvevent.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/xvevent.c b/src/xvevent.c index 13cdf47..48a1f0d 100644 --- a/src/xvevent.c +++ b/src/xvevent.c @@ -89,6 +89,7 @@ int EventLoop() #ifdef USE_TICKS clock_t waitsec_ticks=0L, orgtime_ticks=0L, curtime_ticks; clock_t elapsed_ticks=0L, remaining_interval; + clock_t clock_ticks = sysconf(_SC_CLK_TCK); #else time_t orgtime=0L, curtime; #endif @@ -135,7 +136,7 @@ int EventLoop() all pending events (ie, drawing the image the first time) have been dealt with: START WAITING */ #ifdef USE_TICKS - waitsec_ticks = (clock_t)(waitsec * CLK_TCK); + waitsec_ticks = (clock_t)(waitsec * clock_ticks); orgtime_ticks = times(NULL); /* unclear if NULL valid, but OK on Linux */ #else orgtime = time(NULL); @@ -181,11 +182,11 @@ int EventLoop() } else elapsed_ticks = curtime_ticks - orgtime_ticks; remaining_interval = waitsec_ticks - elapsed_ticks; - if (remaining_interval >= (clock_t)(1 * CLK_TCK)) + if (remaining_interval >= (clock_t)(1 * clock_ticks)) sleep(1); else { /* less than one second remaining: do delay in msec, then return */ - Timer((remaining_interval * 1000L) / CLK_TCK); /* can't overflow */ + Timer((remaining_interval * 1000L) / clock_ticks); /* can't overflow */ return waitloop? NEXTLOOP : NEXTQUIT; } #else -- 2.35.1