summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Peterson <lavajoe@gentoo.org>2008-05-06 22:31:25 +0000
committerJoe Peterson <lavajoe@gentoo.org>2008-05-06 22:31:25 +0000
commitd369ba54d6619490de7d24c57ff1f31e8c60bdf4 (patch)
treec068fa5d2d5c70902352605be5034f4c9b857aae /media-gfx/xv/files
parentadd new fix for libtool-2.2.4, thanks to Panagiotis Christopoulos <pxrist@gma... (diff)
downloadgentoo-2-d369ba54d6619490de7d24c57ff1f31e8c60bdf4.tar.gz
gentoo-2-d369ba54d6619490de7d24c57ff1f31e8c60bdf4.tar.bz2
gentoo-2-d369ba54d6619490de7d24c57ff1f31e8c60bdf4.zip
Fix -wait option (bug #149270)
(Portage version: 2.1.4.4)
Diffstat (limited to 'media-gfx/xv/files')
-rw-r--r--media-gfx/xv/files/xv-3.10a-fix-wait-20070520.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/media-gfx/xv/files/xv-3.10a-fix-wait-20070520.patch b/media-gfx/xv/files/xv-3.10a-fix-wait-20070520.patch
new file mode 100644
index 000000000000..ec093ab309c9
--- /dev/null
+++ b/media-gfx/xv/files/xv-3.10a-fix-wait-20070520.patch
@@ -0,0 +1,40 @@
+diff -Nur xv-3.10a_old/xvevent.c xv-3.10a/xvevent.c
+--- xv-3.10a_old/xvevent.c 2008-05-06 12:44:41.000000000 -0600
++++ xv-3.10a/xvevent.c 2008-05-06 15:55:59.000000000 -0600
+@@ -82,7 +82,7 @@
+ int retval,done,waiting;
+ #ifdef USE_TICKS
+ clock_t waitsec_ticks=0L, orgtime_ticks=0L, curtime_ticks;
+- clock_t elapsed_ticks=0L, remaining_interval;
++ clock_t elapsed_ticks=0L, remaining_interval, clock_ticks_per_sec;
+ #else
+ time_t orgtime=0L, curtime;
+ #endif
+@@ -126,7 +126,8 @@
+ 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);
++ clock_ticks_per_sec = sysconf(_SC_CLK_TCK);
++ waitsec_ticks = (clock_t)(waitsec * clock_ticks_per_sec);
+ orgtime_ticks = times(NULL); /* unclear if NULL valid, but OK on Linux */
+ #else
+ orgtime = time(NULL);
+@@ -168,11 +169,14 @@
+ } 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_ticks_per_sec)
+ sleep(1);
+ else {
+- /* less than one second remaining: do delay in msec, then return */
+- Timer((remaining_interval * 1000L) / CLK_TCK); /* can't overflow */
++ if (remaining_interval > 0) {
++ /* less than one second remaining: do delay in msec, then return */
++ Timer((remaining_interval * 1000L) / clock_ticks_per_sec); /* can't overflow */
++ }
++
+ return waitloop? NEXTLOOP : NEXTQUIT;
+ }
+ #else