summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-24 17:10:06 +0000
committernick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-24 17:10:06 +0000
commit93c371d589b200d8d9126d286847bdb1df556c54 (patch)
treeba0c1c53dd3cc91e5863fe5faf92449e34d3b9fd
parenta4119f6b1568523dc3932478518857b24d84ae17 (diff)
downloadmpv-93c371d589b200d8d9126d286847bdb1df556c54.tar.bz2
mpv-93c371d589b200d8d9126d286847bdb1df556c54.tar.xz
exclude benchmark stuff execution from normal playback
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4845 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--dec_video.c15
-rw-r--r--mencoder.c3
-rw-r--r--mplayer.c26
3 files changed, 31 insertions, 13 deletions
diff --git a/dec_video.c b/dec_video.c
index 5c26dcffc4..17ff9ac163 100644
--- a/dec_video.c
+++ b/dec_video.c
@@ -38,6 +38,7 @@ extern int verbose; // defined in mplayer.c
// ===================================================================
+extern int benchmark;
extern double video_time_usage;
extern double vout_time_usage;
extern double max_video_time_usage;
@@ -1219,8 +1220,11 @@ else if(gCpuCaps.hasMMX){
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 @@ case 2:
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;
}
diff --git a/mencoder.c b/mencoder.c
index 3e3955e77c..9901316a14 100644
--- a/mencoder.c
+++ b/mencoder.c
@@ -147,7 +147,6 @@ int out_video_codec=
//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_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;
+int benchmark=0;
// A-V sync:
int delay_corrected=1;
diff --git a/mplayer.c b/mplayer.c
index 80e664a058..2e56923132 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -184,7 +184,7 @@ 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;
+int benchmark=0;
static unsigned bench_dropped_frames=0;
// static int play_in_bg=0;
@@ -1562,7 +1562,10 @@ InitTimer();
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 @@ while(sh_audio){
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 @@ if(!(vo_flags&256)){ // flag 256 means: libvo driver does its timing (dvb card)
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;