[MPlayer-dev-eng] [PATCH] xscreensaver timeout for short files

Joseph Parmelee jparmele at wildbear.com
Thu Feb 26 19:52:02 CET 2004


Hello:

Attached is a short patch to fix xscreensaver timeouts during a sequence or
loop of files shorter than 30 seconds.

Because time_last is initialized to zero implicitly, the xscrensaver timer
does not get bumped until the movie has been playing for 30 seconds and thus
doesn't occur at all during short files.  A sequence or loop of such files
can allow xscreensaver to start.  The patch insures that the xscreensaver
timer gets reset at least once per file or time around the loop.

This patch is applied against mplayer-1.0pre3 in the top-level source
directory using patch -p0.

I realize that you prefer patches against CVS, but we are a system
integrator and must deal with release versions of many many many different
packages.  We simply do not have time to download, build, and test unstable
CVS versions of any of them.  Patches against releases are the only kind we
make.  Sorry.

It seemed better to send it in this form than not at all.  Do with it as you
see fit.


Keep up the good work with mplayer.


Regards,

Joseph Parmelee
-------------- next part --------------
--- libvo/x11_common.c.orig	Mon Dec  8 06:03:03 2003
+++ libvo/x11_common.c	Wed Feb 25 16:12:16 2004
@@ -1134,7 +1134,8 @@
 static Atom deactivate;
 static Atom screensaver;
 
-static float time_last;
+
+extern float time_last;
 
 void xscreensaver_heartbeat(float time)
 {
--- mplayer.c.orig	Mon Dec  8 15:33:31 2003
+++ mplayer.c	Wed Feb 25 16:24:14 2004
@@ -50,6 +50,8 @@
 
 #ifdef HAVE_X11
 #include "libvo/x11_common.h"
+#include <math.h>
+float time_last;
 #endif
 
 #include "libao2/audio_out.h"
@@ -1948,6 +1950,11 @@
   eof=PT_NEXT_ENTRY; goto goto_next_file;
 }
 
+#ifdef HAVE_X11
+// Insure xscreensaver timer is reset during files shorter than 30 seconds
+time_last = HUGE_VAL;
+#endif
+
 while(!eof){
     float aq_sleep_time=0;
 
@@ -3367,6 +3374,9 @@
     eof=0;
     abs_seek_pos=3; rel_seek_secs=0; // seek to start of movie (0%)
     loop_seek = 1;
+#ifdef HAVE_X11
+    time_last = HUGE_VAL;
+#endif
   }
 
 if(rel_seek_secs || abs_seek_pos){


More information about the MPlayer-dev-eng mailing list