[MPlayer-cvslog] CVS: main mplayer.c, 1.944, 1.945 mplayer.h, 1.31, 1.32

Uoti Urpala CVS syncmail at mplayerhq.hu
Tue Apr 25 23:36:03 CEST 2006


CVS change done by Uoti Urpala CVS

Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv27348

Modified Files:
	mplayer.c mplayer.h 
Log Message:
Remove updating of vo_mouse_timer_const from the main loop and also
remove the variable itself. Convert code in x11_common.c and OSD timing
that depended on the variable to use real time instead.


Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.944
retrieving revision 1.945
diff -u -r1.944 -r1.945
--- mplayer.c	25 Apr 2006 20:32:46 -0000	1.944
+++ mplayer.c	25 Apr 2006 21:36:00 -0000	1.945
@@ -239,7 +239,8 @@
 
 int osd_level=1;
 int osd_level_saved=-1;
-int osd_visible=100;
+// if nonzero, hide current OSD contents when GetTimerMS() reaches this
+unsigned int osd_visible;
 static int osd_function=OSD_PLAY;
 static int osd_show_percentage = 0;
 static int osd_duration = 1000;
@@ -1229,7 +1230,7 @@
     
 #ifdef USE_OSD
     if(sh_video) {
-        osd_visible = sh_video->fps;
+        osd_visible = (GetTimerMS() + 1000) | 1;
         vo_osd_progbar_type = type;
         vo_osd_progbar_value = 256*(val-min)/(max-min);
         vo_osd_changed(OSDTYPE_PROGBAR);
@@ -3195,9 +3196,6 @@
       sh_video->frametime=1.0f/sh_video->fps;
     }
     vo_fps = sh_video->fps;
-#ifdef HAVE_X11
-    vo_mouse_timer_const=(int)sh_video->fps;
-#endif
 
     if(!sh_video->fps && !force_fps){
       mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_FPSnotspecified);
@@ -3725,9 +3723,6 @@
 	time_frame+=frame_time;  // for nosound
 	// video_read_frame can change fps (e.g. for asf video)
 	vo_fps = sh_video->fps;
-#ifdef HAVE_X11
-	vo_mouse_timer_const = (int)sh_video->fps;
-#endif
 	// check for frame-drop:
 	current_module="check_framedrop";
 	if(sh_audio && !d_audio->eof){
@@ -4056,7 +4051,10 @@
 
 #ifdef USE_OSD
   if(osd_visible){
-    if (!--osd_visible){
+      // 36000000 means max timed visibility is 1 hour into the future, if
+      // the difference is greater assume it's wrapped around from below 0
+    if (osd_visible - GetTimerMS() > 36000000) {
+       osd_visible = 0;
        vo_osd_progbar_type=-1; // disable
        vo_osd_changed(OSDTYPE_PROGBAR);
        if (osd_function != OSD_PAUSE)
@@ -4929,7 +4927,7 @@
       if(sh_video) {
 	c_total=0;
 	max_pts_correction=0.1;
-	osd_visible=sh_video->fps; // to rewert to PLAY pointer after 1 sec
+	osd_visible=(GetTimerMS() + 1000) | 1; // to revert to PLAY pointer after 1 sec
 	audio_time_usage=0; video_time_usage=0; vout_time_usage=0;
 	drop_frame_cnt=0;
 	too_slow_frame_cnt=0;

Index: mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- mplayer.h	9 Feb 2006 14:07:52 -0000	1.31
+++ mplayer.h	25 Apr 2006 21:36:01 -0000	1.32
@@ -20,7 +20,7 @@
 extern float  audio_delay;
 
 extern int osd_level;
-extern int osd_visible;
+extern unsigned int osd_visible;
 
 extern char * font_name;
 extern float  font_factor;




More information about the MPlayer-cvslog mailing list