changeset 5621:0426f9b887cd

some more statistics: BENCHMARKn
author arpi
date Sun, 14 Apr 2002 19:43:23 +0000
parents bbb8b01c76d4
children d354889a3944
files mplayer.c
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Sun Apr 14 19:18:34 2002 +0000
+++ b/mplayer.c	Sun Apr 14 19:43:23 2002 +0000
@@ -159,8 +159,9 @@
 double vout_time_usage=0;
 static double audio_time_usage=0;
 static int total_time_usage_start=0;
+static int total_frame_cnt=0;
+static int drop_frame_cnt=0; // total number of dropped frames
 int benchmark=0;
-static unsigned bench_dropped_frames=0;
 
 // static int play_in_bg=0;
 
@@ -1343,7 +1344,6 @@
 char osd_text_buffer[64];
 int drop_frame=0;     // current dropping status
 int dropped_frames=0; // how many frames dropped since last non-dropped frame
-int drop_frame_cnt=0; // total number of dropped frames
 int too_slow_frame_cnt=0;
 int too_fast_frame_cnt=0;
 // for auto-quality:
@@ -1522,6 +1522,7 @@
 	    } else {
 		drop_frame=dropped_frames=0;
 	    }
+	    ++total_frame_cnt;
 	}
 	// decode:
 	current_module="decode_video";
@@ -2866,6 +2867,15 @@
 	   100.0*audio_time_usage/total_time_usage,
 	   100.0*(total_time_usage-tot)/total_time_usage,
 	   100.0);
+  if(total_frame_cnt)
+    mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARKn: disp: %d (%3.2f fps)  drop: %d (%d%%)  total: %d (%3.2f fps)\n",
+	total_frame_cnt-drop_frame_cnt,
+	(total_time_usage>0.5)?((total_frame_cnt-drop_frame_cnt)/total_time_usage):0,
+	drop_frame_cnt,
+	100*drop_frame_cnt/total_frame_cnt,
+	total_frame_cnt,
+	(total_time_usage>0.5)?(total_frame_cnt/total_time_usage):0);
+  
 }
 
 #ifdef HAVE_NEW_GUI