[Mplayer-cvslog] CVS: main mplayer.c,1.412,1.413 mencoder.c,1.93,1.94 dec_video.c,1.109,1.110

Nick Kurshev nick at mplayer.dev.hu
Sun Feb 24 18:10:08 CET 2002


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv348/main

Modified Files:
	mplayer.c mencoder.c dec_video.c 
Log Message:
exclude benchmark stuff execution from normal playback

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.412
retrieving revision 1.413
diff -u -r1.412 -r1.413
--- mplayer.c	24 Feb 2002 17:00:19 -0000	1.412
+++ mplayer.c	24 Feb 2002 17:10:06 -0000	1.413
@@ -184,7 +184,7 @@
 static double max_audio_time_usage=0;
 static double cur_audio_time_usage=0;
 static int total_time_usage_start=0;
-static int benchmark=0;
+int benchmark=0;
 static unsigned bench_dropped_frames=0;
 
 // static int play_in_bg=0;
@@ -1562,7 +1562,10 @@
 
 total_time_usage_start=GetTimer();
 audio_time_usage=0; video_time_usage=0; vout_time_usage=0;
-max_audio_time_usage=0; max_video_time_usage=0; max_vout_time_usage=0;
+if(benchmark) 
+{
+  max_audio_time_usage=0; max_video_time_usage=0; max_vout_time_usage=0;
+}
 while(!eof){
 //    unsigned int aq_total_time=GetTimer();
     float aq_sleep_time=0;
@@ -1608,8 +1611,11 @@
   t=GetTimer()-t;
   tt = t*0.000001f;
   audio_time_usage+=tt;
-  if(tt > max_audio_time_usage) max_audio_time_usage = tt;
-  cur_audio_time_usage=tt;
+  if(benchmark)
+  {
+    if(tt > max_audio_time_usage) max_audio_time_usage = tt;
+    cur_audio_time_usage=tt;
+  }
   if(playsize>sh_audio->a_buffer_len) playsize=sh_audio->a_buffer_len;
   
   playsize=audio_out->play(sh_audio->a_buffer,playsize,0);
@@ -1861,17 +1867,23 @@
 	   t2=GetTimer()-t2;
 	   tt = t2*0.000001f;
 	   vout_time_usage+=tt;
-	   if(cur_vout_time_usage + tt > max_vout_time_usage)
+	   if(benchmark)
+	   {
+	    if(cur_vout_time_usage + tt > max_vout_time_usage)
 		    max_vout_time_usage = cur_vout_time_usage + tt;
-	   our_n_frames++;
+	    our_n_frames++;
+	   }
 	}
 #endif
 //        usec_sleep(50000); // test only!
 
     }
 /*  Compute total frame dropping here */
-    if((cur_video_time_usage + cur_vout_time_usage + cur_audio_time_usage)*vo_fps > 1)
+    if(benchmark)
+    {
+	if((cur_video_time_usage + cur_vout_time_usage + cur_audio_time_usage)*vo_fps > 1)
 							bench_dropped_frames ++;
+    }
     current_module=NULL;
     
     if(eof) break;

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- mencoder.c	24 Feb 2002 15:54:13 -0000	1.93
+++ mencoder.c	24 Feb 2002 17:10:06 -0000	1.94
@@ -147,7 +147,6 @@
 //void resync_audio_stream(sh_audio_t *sh_audio){}
 
 int verbose=0; // must be global!
-
 double video_time_usage=0;
 double vout_time_usage=0;
 double max_video_time_usage=0;
@@ -156,7 +155,7 @@
 double cur_vout_time_usage=0;
 static double audio_time_usage=0;
 static int total_time_usage_start=0;
-static int benchmark=0;
+int benchmark=0;
 
 // A-V sync:
 int delay_corrected=1;

Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_video.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -r1.109 -r1.110
--- dec_video.c	24 Feb 2002 15:54:13 -0000	1.109
+++ dec_video.c	24 Feb 2002 17:10:06 -0000	1.110
@@ -38,6 +38,7 @@
 
 // ===================================================================
 
+extern int benchmark;
 extern double video_time_usage;
 extern double vout_time_usage;
 extern double max_video_time_usage;
@@ -1219,8 +1220,11 @@
 t2=GetTimer();t=t2-t;
 tt = t*0.000001f;
 video_time_usage+=tt;
-if(tt > max_video_time_usage) max_video_time_usage=tt;
-cur_video_time_usage=tt;
+if(benchmark)
+{
+    if(tt > max_video_time_usage) max_video_time_usage=tt;
+    cur_video_time_usage=tt;
+}
 if(painted) return 1;
 switch(blit_frame){
 case 3:
@@ -1280,8 +1284,11 @@
     t2=GetTimer()-t2;
     tt=t2*0.000001f;
     vout_time_usage+=tt;
-    if(tt > max_vout_time_usage) max_vout_time_usage = tt;
-    cur_vout_time_usage=tt;
+    if(benchmark)
+    {
+	if(tt > max_vout_time_usage) max_vout_time_usage = tt;
+	cur_vout_time_usage=tt;
+    }
     blit_frame=1;
     break;
 }




More information about the MPlayer-cvslog mailing list