[Mplayer-cvslog] CVS: main mplayer.c,1.158,1.159 cfg-mplayer.h,1.59,1.60

GEREOFFY arpi_esp at users.sourceforge.net
Wed Jun 13 23:55:26 CEST 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv32048

Modified Files:
	mplayer.c cfg-mplayer.h 
Log Message:
-frames and -benchmark options to make chl & gabucino happy

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.158
retrieving revision 1.159
diff -C2 -r1.158 -r1.159
*** mplayer.c	2001/06/08 23:35:23	1.158
--- mplayer.c	2001/06/13 21:55:24	1.159
***************
*** 282,285 ****
--- 282,291 ----
  static ao_functions_t *audio_out=NULL;
  
+ double video_time_usage=0;
+ double vout_time_usage=0;
+ double audio_time_usage=0;
+ int total_time_usage_start=0;
+ int benchmark=0;
+ 
  static int play_in_bg=0;
  
***************
*** 295,298 ****
--- 301,306 ----
  void exit_player(char* how){
  
+  total_time_usage_start=GetTimer()-total_time_usage_start;
+ 
  #ifdef HAVE_GUI
   if ( !nogui )
***************
*** 310,313 ****
--- 318,335 ----
    if(how) printf("\nExiting... (%s)\n",how);
    if(verbose) printf("max framesize was %d bytes\n",max_framesize);
+   if(benchmark){
+       double tot=video_time_usage+vout_time_usage+audio_time_usage;
+       double total_time_usage=(float)total_time_usage_start*0.000001;
+       printf("BENCHMARKs: V:%8.3fs VO:%8.3fs A:%8.3fs Sys:%8.3fs = %8.3fs\n",
+           video_time_usage,vout_time_usage,audio_time_usage,
+ 	  total_time_usage-tot,total_time_usage);
+       if(total_time_usage>0.0)
+       printf("BENCHMARK%%: V:%8.4f%% VO:%8.4f%% A:%8.4f%% Sys:%8.4f%% = %8.4f%%\n",
+           100.0*video_time_usage/total_time_usage,
+ 	  100.0*vout_time_usage/total_time_usage,
+ 	  100.0*audio_time_usage/total_time_usage,
+ 	  100.0*(total_time_usage-tot)/total_time_usage,
+ 	  100.0);
+   }
    // restore terminal:
    #ifdef HAVE_GUI
***************
*** 402,405 ****
--- 424,428 ----
  float audio_delay=0;
  int frame_dropping=0; // option  0=no drop  1= drop vo  2= drop decode
+ int play_n_frames=-1;
  
  // screen info:
***************
*** 1356,1362 ****
  int force_redraw=0;
  float num_frames=0;      // number of frames played
- double video_time_usage=0;
- double vout_time_usage=0;
- double audio_time_usage=0;
  int grab_frames=0;
  char osd_text_buffer[64];
--- 1379,1382 ----
***************
*** 1475,1478 ****
--- 1495,1500 ----
  InitTimer();
  
+ total_time_usage_start=GetTimer();
+ 
  while(!eof){
  
***************
*** 1792,1796 ****
  	  }
        } else {
!           if(time_frame<-3*frame_time || time_frame>3*frame_time) time_frame=0;
        }
  
--- 1814,1820 ----
  	  }
        } else {
!           if( (time_frame<-3*frame_time || time_frame>3*frame_time) || benchmark)
! 	      time_frame=0;
! 	  
        }
  
***************
*** 1812,1815 ****
--- 1836,1844 ----
  
      current_module=NULL;
+     
+     if(play_n_frames>=0){
+       --play_n_frames;
+       if(play_n_frames<0) exit_player("Requested number of frames played");
+     }
      
      if(eof) break;

Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -r1.59 -r1.60
*** cfg-mplayer.h	2001/06/12 14:24:26	1.59
--- cfg-mplayer.h	2001/06/13 21:55:24	1.60
***************
*** 97,100 ****
--- 97,103 ----
  	{"hardframedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 0, 2},
  	{"noframedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 1, 0},
+ 
+ 	{"frames", &play_n_frames, CONF_TYPE_INT, CONF_MIN, 0, 0},
+ 	{"benchmark", &benchmark, CONF_TYPE_FLAG, 0, 0, 1},
  	
  	{"aid", &audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 256},


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list