comparison mplayer.c @ 4221:401149ba73fd

Fixed bug with benchmark option
author albeu
date Thu, 17 Jan 2002 20:25:55 +0000
parents 7cfa69df9e0b
children 1bdb44f7cba2
comparison
equal deleted inserted replaced
4220:fe2c20d52a25 4221:401149ba73fd
343 current_module=NULL; 343 current_module=NULL;
344 344
345 } 345 }
346 346
347 void exit_player(char* how){ 347 void exit_player(char* how){
348 total_time_usage_start=GetTimer()-total_time_usage_start;
349 348
350 uninit_player(INITED_ALL); 349 uninit_player(INITED_ALL);
351 350
352 current_module="exit_player"; 351 current_module="exit_player";
353 352
354 if(how) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_Exiting,how); 353 if(how) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_Exiting,how);
355 mp_msg(MSGT_CPLAYER,MSGL_V,"max framesize was %d bytes\n",max_framesize); 354 mp_msg(MSGT_CPLAYER,MSGL_V,"max framesize was %d bytes\n",max_framesize);
356 if(benchmark){
357 double tot=video_time_usage+vout_time_usage+audio_time_usage;
358 double total_time_usage=(float)total_time_usage_start*0.000001;
359 mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARKs: V:%8.3fs VO:%8.3fs A:%8.3fs Sys:%8.3fs = %8.3fs\n",
360 video_time_usage,vout_time_usage,audio_time_usage,
361 total_time_usage-tot,total_time_usage);
362 if(total_time_usage>0.0)
363 mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARK%%: V:%8.4f%% VO:%8.4f%% A:%8.4f%% Sys:%8.4f%% = %8.4f%%\n",
364 100.0*video_time_usage/total_time_usage,
365 100.0*vout_time_usage/total_time_usage,
366 100.0*audio_time_usage/total_time_usage,
367 100.0*(total_time_usage-tot)/total_time_usage,
368 100.0);
369 }
370 355
371 exit(1); 356 exit(1);
372 } 357 }
373 358
374 void exit_sighandler(int x){ 359 void exit_sighandler(int x){
2364 2349
2365 } 2350 }
2366 2351
2367 goto_next_file: // don't jump here after ao/vo/getch initialization! 2352 goto_next_file: // don't jump here after ao/vo/getch initialization!
2368 2353
2354
2355 if(benchmark){
2356 double tot=video_time_usage+vout_time_usage+audio_time_usage;
2357 double total_time_usage;
2358 total_time_usage_start=GetTimer()-total_time_usage_start;
2359 total_time_usage = (float)total_time_usage_start*0.000001;
2360 mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARKs: V:%8.3fs VO:%8.3fs A:%8.3fs Sys:%8.3fs = %8.3fs\n",
2361 video_time_usage,vout_time_usage,audio_time_usage,
2362 total_time_usage-tot,total_time_usage);
2363 if(total_time_usage>0.0)
2364 mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARK%%: V:%8.4f%% VO:%8.4f%% A:%8.4f%% Sys:%8.4f%% = %8.4f%%\n",
2365 100.0*video_time_usage/total_time_usage,
2366 100.0*vout_time_usage/total_time_usage,
2367 100.0*audio_time_usage/total_time_usage,
2368 100.0*(total_time_usage-tot)/total_time_usage,
2369 100.0);
2370 }
2371
2369 if(eof == PT_NEXT_ENTRY || eof == PT_PREV_ENTRY) { 2372 if(eof == PT_NEXT_ENTRY || eof == PT_PREV_ENTRY) {
2373 eof = eof == PT_NEXT_ENTRY ? 1 : -1;
2370 if(play_tree_iter_step(playtree_iter,eof,0) == PLAY_TREE_ITER_ENTRY) { 2374 if(play_tree_iter_step(playtree_iter,eof,0) == PLAY_TREE_ITER_ENTRY) {
2371 uninit_player(INITED_ALL-(INITED_GUI+INITED_LIRC)); 2375 uninit_player(INITED_ALL-(INITED_GUI+INITED_LIRC));
2372 eof = 1; 2376 eof = 1;
2373 } else { 2377 } else {
2374 play_tree_iter_free(playtree_iter); 2378 play_tree_iter_free(playtree_iter);