comparison mplayer.c @ 26159:7862aea6a387

cosmetics: Decrapify the indentation of the last few blocks of main().
author diego
date Fri, 07 Mar 2008 17:16:10 +0000
parents e17acc5feca4
children 089dc00275b6
comparison
equal deleted inserted replaced
26158:5c53b397a536 26159:7862aea6a387
3905 goto_next_file: // don't jump here after ao/vo/getch initialization! 3905 goto_next_file: // don't jump here after ao/vo/getch initialization!
3906 3906
3907 mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n"); 3907 mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n");
3908 3908
3909 if(benchmark){ 3909 if(benchmark){
3910 double tot=video_time_usage+vout_time_usage+audio_time_usage; 3910 double tot=video_time_usage+vout_time_usage+audio_time_usage;
3911 double total_time_usage; 3911 double total_time_usage;
3912 total_time_usage_start=GetTimer()-total_time_usage_start; 3912 total_time_usage_start=GetTimer()-total_time_usage_start;
3913 total_time_usage = (float)total_time_usage_start*0.000001; 3913 total_time_usage = (float)total_time_usage_start*0.000001;
3914 mp_msg(MSGT_CPLAYER,MSGL_INFO,"\nBENCHMARKs: VC:%8.3fs VO:%8.3fs A:%8.3fs Sys:%8.3fs = %8.3fs\n", 3914 mp_msg(MSGT_CPLAYER,MSGL_INFO,"\nBENCHMARKs: VC:%8.3fs VO:%8.3fs A:%8.3fs Sys:%8.3fs = %8.3fs\n",
3915 video_time_usage,vout_time_usage,audio_time_usage, 3915 video_time_usage,vout_time_usage,audio_time_usage,
3916 total_time_usage-tot,total_time_usage); 3916 total_time_usage-tot,total_time_usage);
3917 if(total_time_usage>0.0) 3917 if(total_time_usage>0.0)
3918 mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARK%%: VC:%8.4f%% VO:%8.4f%% A:%8.4f%% Sys:%8.4f%% = %8.4f%%\n", 3918 mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARK%%: VC:%8.4f%% VO:%8.4f%% A:%8.4f%% Sys:%8.4f%% = %8.4f%%\n",
3919 100.0*video_time_usage/total_time_usage, 3919 100.0*video_time_usage/total_time_usage,
3920 100.0*vout_time_usage/total_time_usage, 3920 100.0*vout_time_usage/total_time_usage,
3921 100.0*audio_time_usage/total_time_usage, 3921 100.0*audio_time_usage/total_time_usage,
3922 100.0*(total_time_usage-tot)/total_time_usage, 3922 100.0*(total_time_usage-tot)/total_time_usage,
3923 100.0); 3923 100.0);
3924 if(total_frame_cnt && frame_dropping) 3924 if(total_frame_cnt && frame_dropping)
3925 mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARKn: disp: %d (%3.2f fps) drop: %d (%d%%) total: %d (%3.2f fps)\n", 3925 mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARKn: disp: %d (%3.2f fps) drop: %d (%d%%) total: %d (%3.2f fps)\n",
3926 total_frame_cnt-drop_frame_cnt, 3926 total_frame_cnt-drop_frame_cnt,
3927 (total_time_usage>0.5)?((total_frame_cnt-drop_frame_cnt)/total_time_usage):0, 3927 (total_time_usage>0.5)?((total_frame_cnt-drop_frame_cnt)/total_time_usage):0,
3928 drop_frame_cnt, 3928 drop_frame_cnt,
3929 100*drop_frame_cnt/total_frame_cnt, 3929 100*drop_frame_cnt/total_frame_cnt,
3930 total_frame_cnt, 3930 total_frame_cnt,
3931 (total_time_usage>0.5)?(total_frame_cnt/total_time_usage):0); 3931 (total_time_usage>0.5)?(total_frame_cnt/total_time_usage):0);
3932
3933 } 3932 }
3934 3933
3935 // time to uninit all, except global stuff: 3934 // time to uninit all, except global stuff:
3936 uninit_player(INITIALIZED_ALL-(INITIALIZED_GUI+INITIALIZED_INPUT+(fixed_vo?INITIALIZED_VO:0))); 3935 uninit_player(INITIALIZED_ALL-(INITIALIZED_GUI+INITIALIZED_INPUT+(fixed_vo?INITIALIZED_VO:0)));
3937 3936
3938 if ( mpctx->set_of_sub_size > 0 ) 3937 if(mpctx->set_of_sub_size > 0) {
3939 {
3940 current_module="sub_free"; 3938 current_module="sub_free";
3941 for (i = 0; i < mpctx->set_of_sub_size; ++i) { 3939 for(i = 0; i < mpctx->set_of_sub_size; ++i) {
3942 sub_free( mpctx->set_of_subtitles[i] ); 3940 sub_free(mpctx->set_of_subtitles[i]);
3943 #ifdef USE_ASS 3941 #ifdef USE_ASS
3944 if ( mpctx->set_of_ass_tracks[i] ) 3942 if(mpctx->set_of_ass_tracks[i])
3945 ass_free_track( mpctx->set_of_ass_tracks[i] ); 3943 ass_free_track( mpctx->set_of_ass_tracks[i] );
3946 #endif 3944 #endif
3947 } 3945 }
3948 mpctx->set_of_sub_size = 0; 3946 mpctx->set_of_sub_size = 0;
3949 } 3947 }
3950 vo_sub_last = vo_sub=NULL; 3948 vo_sub_last = vo_sub=NULL;
3951 subdata=NULL; 3949 subdata=NULL;
3952 #ifdef USE_ASS 3950 #ifdef USE_ASS
3953 ass_track = NULL; 3951 ass_track = NULL;
3954 if (ass_library) 3952 if(ass_library)
3955 ass_clear_fonts(ass_library); 3953 ass_clear_fonts(ass_library);
3956 #endif 3954 #endif
3957 3955
3958 if(mpctx->eof == PT_NEXT_ENTRY || mpctx->eof == PT_PREV_ENTRY) { 3956 if(mpctx->eof == PT_NEXT_ENTRY || mpctx->eof == PT_PREV_ENTRY) {
3959 mpctx->eof = mpctx->eof == PT_NEXT_ENTRY ? 1 : -1; 3957 mpctx->eof = mpctx->eof == PT_NEXT_ENTRY ? 1 : -1;
3960 if(play_tree_iter_step(mpctx->playtree_iter,mpctx->play_tree_step,0) == PLAY_TREE_ITER_ENTRY) { 3958 if(play_tree_iter_step(mpctx->playtree_iter,mpctx->play_tree_step,0) == PLAY_TREE_ITER_ENTRY) {
3961 mpctx->eof = 1; 3959 mpctx->eof = 1;
3962 } else {
3963 play_tree_iter_free(mpctx->playtree_iter);
3964 mpctx->playtree_iter = NULL;
3965 }
3966 mpctx->play_tree_step = 1;
3967 } else if (mpctx->eof == PT_UP_NEXT || mpctx->eof == PT_UP_PREV) {
3968 mpctx->eof = mpctx->eof == PT_UP_NEXT ? 1 : -1;
3969 if ( mpctx->playtree_iter ) {
3970 if(play_tree_iter_up_step(mpctx->playtree_iter,mpctx->eof,0) == PLAY_TREE_ITER_ENTRY) {
3971 mpctx->eof = 1;
3972 } else { 3960 } else {
3973 play_tree_iter_free(mpctx->playtree_iter); 3961 play_tree_iter_free(mpctx->playtree_iter);
3974 mpctx->playtree_iter = NULL; 3962 mpctx->playtree_iter = NULL;
3975 } 3963 }
3976 } 3964 mpctx->play_tree_step = 1;
3965 } else if(mpctx->eof == PT_UP_NEXT || mpctx->eof == PT_UP_PREV) {
3966 mpctx->eof = mpctx->eof == PT_UP_NEXT ? 1 : -1;
3967 if(mpctx->playtree_iter) {
3968 if(play_tree_iter_up_step(mpctx->playtree_iter,mpctx->eof,0) == PLAY_TREE_ITER_ENTRY) {
3969 mpctx->eof = 1;
3970 } else {
3971 play_tree_iter_free(mpctx->playtree_iter);
3972 mpctx->playtree_iter = NULL;
3973 }
3974 }
3977 } else { // NEXT PREV SRC 3975 } else { // NEXT PREV SRC
3978 mpctx->eof = mpctx->eof == PT_PREV_SRC ? -1 : 1; 3976 mpctx->eof = mpctx->eof == PT_PREV_SRC ? -1 : 1;
3979 } 3977 }
3980 3978
3981 if(mpctx->eof == 0) mpctx->eof = 1; 3979 if(mpctx->eof == 0) mpctx->eof = 1;
3982 3980
3983 while(mpctx->playtree_iter != NULL) { 3981 while(mpctx->playtree_iter != NULL) {
3984 filename = play_tree_iter_get_file(mpctx->playtree_iter,mpctx->eof); 3982 filename = play_tree_iter_get_file(mpctx->playtree_iter,mpctx->eof);
3985 if(filename == NULL) { 3983 if(filename == NULL) {
3986 if( play_tree_iter_step(mpctx->playtree_iter,mpctx->eof,0) != PLAY_TREE_ITER_ENTRY) { 3984 if(play_tree_iter_step(mpctx->playtree_iter,mpctx->eof,0) != PLAY_TREE_ITER_ENTRY) {
3987 play_tree_iter_free(mpctx->playtree_iter); 3985 play_tree_iter_free(mpctx->playtree_iter);
3988 mpctx->playtree_iter = NULL; 3986 mpctx->playtree_iter = NULL;
3989 }; 3987 };
3990 } else 3988 } else
3991 break; 3989 break;
3992 } 3990 }
3993 3991
3994 #ifdef HAVE_NEW_GUI 3992 #ifdef HAVE_NEW_GUI
3995 if( use_gui && !mpctx->playtree_iter ) 3993 if(use_gui && !mpctx->playtree_iter) {
3996 {
3997 #ifdef USE_DVDREAD 3994 #ifdef USE_DVDREAD
3998 if ( !guiIntfStruct.DiskChanged ) 3995 if(!guiIntfStruct.DiskChanged)
3999 #endif 3996 #endif
4000 mplEnd(); 3997 mplEnd();
4001 } 3998 }
4002 #endif 3999 #endif
4003 4000
4004 if(use_gui || mpctx->playtree_iter != NULL || player_idle_mode){ 4001 if(use_gui || mpctx->playtree_iter != NULL || player_idle_mode){
4005 if (!mpctx->playtree_iter) filename = NULL; 4002 if(!mpctx->playtree_iter) filename = NULL;
4006 mpctx->eof = 0; 4003 mpctx->eof = 0;
4007 goto play_next_file; 4004 goto play_next_file;
4008 } 4005 }
4009 4006
4010 4007
4011 exit_player_with_rc(MSGTR_Exit_eof, 0); 4008 exit_player_with_rc(MSGTR_Exit_eof, 0);
4012 4009