[Mplayer-cvslog] CVS: main mplayer.c,1.408,1.409 mencoder.c,1.92,1.93 dec_video.c,1.108,1.109

Nick Kurshev nick at mplayer.dev.hu
Sun Feb 24 16:54:21 CET 2002


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

Modified Files:
	mplayer.c mencoder.c dec_video.c 
Log Message:
frame dropping prediction with benchmarks

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.408
retrieving revision 1.409
diff -u -r1.408 -r1.409
--- mplayer.c	24 Feb 2002 12:05:12 -0000	1.408
+++ mplayer.c	24 Feb 2002 15:54:13 -0000	1.409
@@ -178,10 +178,14 @@
 double vout_time_usage=0;
 double max_video_time_usage=0;
 double max_vout_time_usage=0;
+double cur_video_time_usage=0;
+double cur_vout_time_usage=0;
 static double audio_time_usage=0;
 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;
+static unsigned bench_dropped_frames=0;
 
 // static int play_in_bg=0;
 
@@ -1606,7 +1610,7 @@
   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(playsize>sh_audio->a_buffer_len) playsize=sh_audio->a_buffer_len;
   
   playsize=audio_out->play(sh_audio->a_buffer,playsize,0);
@@ -1842,7 +1846,7 @@
 	video_out->check_events();
         if(blit_frame){
 	   unsigned int t2=GetTimer();
-
+	   double tt;
 	   float j;
 #define	FRAME_LAG_WARN	0.2
 	   j = ((float)t2 - lastframeout_ts) / 1000000;
@@ -1855,13 +1859,19 @@
 		/* printf ("PANIC: too slow frame (%.3f)!\n", j); */
 
 	   video_out->flip_page();
-	   t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f;
+	   t2=GetTimer()-t2;
+	   tt = t2*0.000001f;
+	   vout_time_usage+=tt;
+	   if(cur_vout_time_usage + tt > max_vout_time_usage)
+		    max_vout_time_usage = cur_vout_time_usage + tt;
 	}
 #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)
+							bench_dropped_frames ++;
     current_module=NULL;
     
     if(eof) break;
@@ -2870,6 +2880,7 @@
 	   100.0*max_vout_time_usage/total_time_usage+
 	   100.0*max_audio_time_usage/total_time_usage
 	   );
+    mp_msg(MSGT_CPLAYER,MSGL_INFO,"TOTAL BENCHMARK%%: dropped frames: %u\n",bench_dropped_frames);
 }
 
 if(eof == PT_NEXT_ENTRY || eof == PT_PREV_ENTRY) {

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- mencoder.c	24 Feb 2002 11:23:48 -0000	1.92
+++ mencoder.c	24 Feb 2002 15:54:13 -0000	1.93
@@ -152,6 +152,8 @@
 double vout_time_usage=0;
 double max_video_time_usage=0;
 double max_vout_time_usage=0;
+double cur_video_time_usage=0;
+double cur_vout_time_usage=0;
 static double audio_time_usage=0;
 static int total_time_usage_start=0;
 static int benchmark=0;

Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_video.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -r1.108 -r1.109
--- dec_video.c	24 Feb 2002 11:23:48 -0000	1.108
+++ dec_video.c	24 Feb 2002 15:54:13 -0000	1.109
@@ -42,6 +42,8 @@
 extern double vout_time_usage;
 extern double max_video_time_usage;
 extern double max_vout_time_usage;
+extern double cur_video_time_usage;
+extern double cur_vout_time_usage;
 extern vo_vaa_t vo_vaa;
 
 extern int frameratecode2framerate[16];
@@ -1218,6 +1220,7 @@
 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(painted) return 1;
 switch(blit_frame){
 case 3:
@@ -1278,6 +1281,7 @@
     tt=t2*0.000001f;
     vout_time_usage+=tt;
     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