comparison mplayer.c @ 16490:f17b3c152fd6

Add comments to a few #endif statements in order to make clear which #ifdef they belong to.
author diego
date Thu, 15 Sep 2005 03:08:35 +0000
parents 3092afa97d36
children 49ef03cb382a
comparison
equal deleted inserted replaced
16489:3092afa97d36 16490:f17b3c152fd6
102 #include <linux/rtc.h> 102 #include <linux/rtc.h>
103 #else 103 #else
104 #include <rtc.h> 104 #include <rtc.h>
105 #define RTC_IRQP_SET RTCIO_IRQP_SET 105 #define RTC_IRQP_SET RTCIO_IRQP_SET
106 #define RTC_PIE_ON RTCIO_PIE_ON 106 #define RTC_PIE_ON RTCIO_PIE_ON
107 #endif 107 #endif /* __linux__ */
108 #endif 108 #endif /* HAVE_RTC */
109 109
110 #ifdef USE_TV 110 #ifdef USE_TV
111 #include "libmpdemux/tv.h" 111 #include "libmpdemux/tv.h"
112 #endif 112 #endif
113 113
811 else if (set_of_sub_size <= 0 && subdata != NULL) { // *subdata was added 811 else if (set_of_sub_size <= 0 && subdata != NULL) { // *subdata was added
812 set_of_subtitles[set_of_sub_pos=set_of_sub_size] = subdata; 812 set_of_subtitles[set_of_sub_pos=set_of_sub_size] = subdata;
813 ++set_of_sub_size; 813 ++set_of_sub_size;
814 } 814 }
815 } 815 }
816 #endif 816 #endif /* USE_SUB */
817 817
818 /* 818 /*
819 * In Mac OS X the SDL-lib is built upon Cocoa. The easiest way to 819 * In Mac OS X the SDL-lib is built upon Cocoa. The easiest way to
820 * make it all work is to use the builtin SDL-bootstrap code, which 820 * make it all work is to use the builtin SDL-bootstrap code, which
821 * will be done automatically by replacing our main() if we include SDL.h. 821 * will be done automatically by replacing our main() if we include SDL.h.
1010 for (i = 0; i < vo_sub_last->lines; i++) { 1010 for (i = 0; i < vo_sub_last->lines; i++) {
1011 fprintf(f, "%s\n", vo_sub_last->text[i]); 1011 fprintf(f, "%s\n", vo_sub_last->text[i]);
1012 } 1012 }
1013 fclose(f); 1013 fclose(f);
1014 } 1014 }
1015 #endif 1015 #endif /* USE_SUB */
1016 1016
1017 int main(int argc,char* argv[]){ 1017 int main(int argc,char* argv[]){
1018 1018
1019 1019
1020 char * mem_ptr; 1020 char * mem_ptr;
1095 #endif 1095 #endif
1096 #ifdef HAVE_SSE2 1096 #ifdef HAVE_SSE2
1097 mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE2"); 1097 mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE2");
1098 #endif 1098 #endif
1099 mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n\n"); 1099 mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n\n");
1100 #endif 1100 #endif /* RUNTIME_CPUDETECT */
1101 #endif 1101 #endif /* defined(ARCH_X86) || defined(ARCH_X86_64) */
1102 1102
1103 #if defined(WIN32) && defined(USE_WIN32DLL) 1103 #if defined(WIN32) && defined(USE_WIN32DLL)
1104 { /*make our codec dirs available for LoadLibraryA()*/ 1104 { /*make our codec dirs available for LoadLibraryA()*/
1105 char tmppath[MAX_PATH*2 + 1]; 1105 char tmppath[MAX_PATH*2 + 1];
1106 char win32path[MAX_PATH]; 1106 char win32path[MAX_PATH];
1203 play_tree_add_bpf(playtree, cwd); 1203 play_tree_add_bpf(playtree, cwd);
1204 } 1204 }
1205 // Import initital playtree into gui 1205 // Import initital playtree into gui
1206 import_initial_playtree_into_gui(playtree, mconfig, enqueue); 1206 import_initial_playtree_into_gui(playtree, mconfig, enqueue);
1207 } 1207 }
1208 #endif 1208 #endif /* HAVE_NEW_GUI */
1209 1209
1210 if(video_driver_list && strcmp(video_driver_list[0],"help")==0){ 1210 if(video_driver_list && strcmp(video_driver_list[0],"help")==0){
1211 list_video_out(); 1211 list_video_out();
1212 opt_exit = 1; 1212 opt_exit = 1;
1213 } 1213 }
1352 vo_font=read_font_desc(MPLAYER_DATADIR "/font/font.desc",font_factor,verbose>1); 1352 vo_font=read_font_desc(MPLAYER_DATADIR "/font/font.desc",font_factor,verbose>1);
1353 } 1353 }
1354 #ifdef HAVE_FONTCONFIG 1354 #ifdef HAVE_FONTCONFIG
1355 } 1355 }
1356 #endif 1356 #endif
1357 #endif 1357 #endif /* USE_OSD */
1358 vo_init_osd(); 1358 vo_init_osd();
1359 1359
1360 #ifdef HAVE_RTC 1360 #ifdef HAVE_RTC
1361 if(!nortc) 1361 if(!nortc)
1362 { 1362 {
1385 // breaks DGA and SVGAlib and VESA drivers: --A'rpi 1385 // breaks DGA and SVGAlib and VESA drivers: --A'rpi
1386 // and now ? -- Pontscho 1386 // and now ? -- Pontscho
1387 if(use_gui) setuid( getuid() ); // strongly test, please check this. 1387 if(use_gui) setuid( getuid() ); // strongly test, please check this.
1388 #endif 1388 #endif
1389 if(rtc_fd<0) 1389 if(rtc_fd<0)
1390 #endif 1390 #endif /* HAVE_RTC */
1391 mp_msg(MSGT_CPLAYER, MSGL_V, "Using %s timing\n", 1391 mp_msg(MSGT_CPLAYER, MSGL_V, "Using %s timing\n",
1392 softsleep?"software":timer_name); 1392 softsleep?"software":timer_name);
1393 1393
1394 #ifdef USE_TERMCAP 1394 #ifdef USE_TERMCAP
1395 if ( !use_gui ) load_termcap(NULL); // load key-codes 1395 if ( !use_gui ) load_termcap(NULL); // load key-codes
1538 filename = play_tree_iter_get_file(playtree_iter,1); 1538 filename = play_tree_iter_get_file(playtree_iter,1);
1539 } 1539 }
1540 } 1540 }
1541 } 1541 }
1542 } 1542 }
1543 #endif 1543 #endif /* HAVE_NEW_GUI */
1544 1544
1545 while (player_idle_mode && !filename) { 1545 while (player_idle_mode && !filename) {
1546 play_tree_t * entry = NULL; 1546 play_tree_t * entry = NULL;
1547 mp_cmd_t * cmd; 1547 mp_cmd_t * cmd;
1548 while (!(cmd = mp_input_get_cmd(0,1,0))) { // wait for command 1548 while (!(cmd = mp_input_get_cmd(0,1,0))) { // wait for command
2017 // setup global sub numbering 2017 // setup global sub numbering
2018 global_sub_indices[SUB_SOURCE_SUBS] = global_sub_size; // the global # of the first sub. 2018 global_sub_indices[SUB_SOURCE_SUBS] = global_sub_size; // the global # of the first sub.
2019 global_sub_size += set_of_sub_size; 2019 global_sub_size += set_of_sub_size;
2020 } 2020 }
2021 } 2021 }
2022 #endif 2022 #endif /* USE_SUB */
2023 2023
2024 if (global_sub_size) { 2024 if (global_sub_size) {
2025 // find the best sub to use 2025 // find the best sub to use
2026 if (vobsub_id >= 0) { 2026 if (vobsub_id >= 0) {
2027 // if user asks for a vobsub id, use that first. 2027 // if user asks for a vobsub id, use that first.
2578 current_module="sleep_soft"; 2578 current_module="sleep_soft";
2579 if(time_frame<0) mp_msg(MSGT_AVSYNC, MSGL_WARN, MSGTR_SoftsleepUnderflow); 2579 if(time_frame<0) mp_msg(MSGT_AVSYNC, MSGL_WARN, MSGTR_SoftsleepUnderflow);
2580 while(time_frame>0) time_frame-=GetRelativeTime(); // burn the CPU 2580 while(time_frame>0) time_frame-=GetRelativeTime(); // burn the CPU
2581 } 2581 }
2582 } 2582 }
2583 #endif 2583 #endif /* SYS_DARWIN */
2584 } 2584 }
2585 2585
2586 //if(!frame_time_remaining){ // should we display the frame now? 2586 //if(!frame_time_remaining){ // should we display the frame now?
2587 2587
2588 //====================== FLIP PAGE (VIDEO BLT): ========================= 2588 //====================== FLIP PAGE (VIDEO BLT): =========================
3340 cache_uninit(stream); 3340 cache_uninit(stream);
3341 goto goto_enable_cache; 3341 goto goto_enable_cache;
3342 } 3342 }
3343 } 3343 }
3344 } 3344 }
3345 #endif 3345 #endif /* HAS_DVBIN_SUPPORT */
3346 break; 3346 break;
3347 case MP_CMD_TV_SET_CHANNEL : { 3347 case MP_CMD_TV_SET_CHANNEL : {
3348 if (file_format == DEMUXER_TYPE_TV) { 3348 if (file_format == DEMUXER_TYPE_TV) {
3349 tv_set_channel((tvi_handle_t*)(demuxer->priv), cmd->args[0].v.s); 3349 tv_set_channel((tvi_handle_t*)(demuxer->priv), cmd->args[0].v.s);
3350 #ifdef USE_OSD 3350 #ifdef USE_OSD
3375 goto goto_enable_cache; 3375 goto goto_enable_cache;
3376 } 3376 }
3377 } 3377 }
3378 } 3378 }
3379 } 3379 }
3380 #endif 3380 #endif /* HAS_DVBIN_SUPPORT */
3381 case MP_CMD_TV_LAST_CHANNEL : { 3381 case MP_CMD_TV_LAST_CHANNEL : {
3382 if (file_format == DEMUXER_TYPE_TV) { 3382 if (file_format == DEMUXER_TYPE_TV) {
3383 tv_last_channel((tvi_handle_t*)(demuxer->priv)); 3383 tv_last_channel((tvi_handle_t*)(demuxer->priv));
3384 #ifdef USE_OSD 3384 #ifdef USE_OSD
3385 if (tv_channel_list) { 3385 if (tv_channel_list) {
3395 } break; 3395 } break;
3396 case MP_CMD_TV_STEP_CHANNEL_LIST : { 3396 case MP_CMD_TV_STEP_CHANNEL_LIST : {
3397 if (file_format == DEMUXER_TYPE_TV) 3397 if (file_format == DEMUXER_TYPE_TV)
3398 tv_step_chanlist((tvi_handle_t*)(demuxer->priv)); 3398 tv_step_chanlist((tvi_handle_t*)(demuxer->priv));
3399 } break; 3399 } break;
3400 #endif 3400 #endif /* USE_TV */
3401 case MP_CMD_SWITCH_VSYNC: { 3401 case MP_CMD_SWITCH_VSYNC: {
3402 vo_vsync = ( cmd->nargs > 0 )? cmd->args[0].v.i : !vo_vsync; 3402 vo_vsync = ( cmd->nargs > 0 )? cmd->args[0].v.i : !vo_vsync;
3403 } break; 3403 } break;
3404 case MP_CMD_VO_FULLSCREEN: 3404 case MP_CMD_VO_FULLSCREEN:
3405 { 3405 {
3550 if (set_of_sub_size <= 0) 3550 if (set_of_sub_size <= 0)
3551 global_sub_indices[SUB_SOURCE_SUBS] = -1; 3551 global_sub_indices[SUB_SOURCE_SUBS] = -1;
3552 set_of_subtitles[set_of_sub_size] = NULL; 3552 set_of_subtitles[set_of_sub_size] = NULL;
3553 } 3553 }
3554 } 3554 }
3555 #endif 3555 #endif /* USE_SUB */
3556 } break; 3556 } break;
3557 case MP_CMD_GET_SUB_VISIBILITY: 3557 case MP_CMD_GET_SUB_VISIBILITY:
3558 { 3558 {
3559 #ifdef USE_SUB 3559 #ifdef USE_SUB
3560 if (sh_video) { 3560 if (sh_video) {
3810 d_dvdsub->id,stream_change->physical); 3810 d_dvdsub->id,stream_change->physical);
3811 // FIXME: need a better way to change SPU id 3811 // FIXME: need a better way to change SPU id
3812 d_dvdsub->id=dvdsub_id=stream_change->physical; 3812 d_dvdsub->id=dvdsub_id=stream_change->physical;
3813 if (vo_spudec) spudec_reset(vo_spudec); 3813 if (vo_spudec) spudec_reset(vo_spudec);
3814 } 3814 }
3815 #endif 3815 #endif /* DVDNAVVERSION > 012 */
3816 break; 3816 break;
3817 } 3817 }
3818 case DVDNAV_AUDIO_STREAM_CHANGE: { 3818 case DVDNAV_AUDIO_STREAM_CHANGE: {
3819 int aid_temp; 3819 int aid_temp;
3820 #if DVDNAVVERSION > 012 3820 #if DVDNAVVERSION > 012
3917 mp_msg(MSGT_CPLAYER, MSGL_V, "Weird DVD Nav cmd %d\n",cmd->args[0].v.i); 3917 mp_msg(MSGT_CPLAYER, MSGL_V, "Weird DVD Nav cmd %d\n",cmd->args[0].v.i);
3918 break; 3918 break;
3919 } 3919 }
3920 break; 3920 break;
3921 } 3921 }
3922 #endif 3922 #endif /* USE_DVDNAV */
3923 default : { 3923 default : {
3924 #ifdef HAVE_NEW_GUI 3924 #ifdef HAVE_NEW_GUI
3925 if ( ( use_gui )&&( cmd->id > MP_CMD_GUI_EVENTS ) ) guiGetEvent( guiIEvent,(char *)cmd->id ); 3925 if ( ( use_gui )&&( cmd->id > MP_CMD_GUI_EVENTS ) ) guiGetEvent( guiIEvent,(char *)cmd->id );
3926 else 3926 else
3927 #endif 3927 #endif
4013 vo_osd_progbar_value=demuxer_get_percent_pos(demuxer) * 256 / 100; 4013 vo_osd_progbar_value=demuxer_get_percent_pos(demuxer) * 256 / 100;
4014 vo_osd_changed(OSDTYPE_PROGBAR); 4014 vo_osd_changed(OSDTYPE_PROGBAR);
4015 } 4015 }
4016 } 4016 }
4017 } 4017 }
4018 #endif 4018 #endif /* USE_OSD */
4019 if(sh_video) { 4019 if(sh_video) {
4020 c_total=0; 4020 c_total=0;
4021 max_pts_correction=0.1; 4021 max_pts_correction=0.1;
4022 osd_visible=sh_video->fps; // to rewert to PLAY pointer after 1 sec 4022 osd_visible=sh_video->fps; // to rewert to PLAY pointer after 1 sec
4023 audio_time_usage=0; video_time_usage=0; vout_time_usage=0; 4023 audio_time_usage=0; video_time_usage=0; vout_time_usage=0;
4084 dvd_priv_t * dvdp = stream->priv; 4084 dvd_priv_t * dvdp = stream->priv;
4085 guiIntfStruct.DVD.current_chapter=dvd_chapter_from_cell(dvdp,guiIntfStruct.DVD.current_title-1, dvdp->cur_cell)+1; 4085 guiIntfStruct.DVD.current_chapter=dvd_chapter_from_cell(dvdp,guiIntfStruct.DVD.current_title-1, dvdp->cur_cell)+1;
4086 } 4086 }
4087 #endif 4087 #endif
4088 } 4088 }
4089 #endif 4089 #endif /* HAVE_NEW_GUI */
4090 4090
4091 4091
4092 //================= Update OSD ==================== 4092 //================= Update OSD ====================
4093 #ifdef USE_OSD 4093 #ifdef USE_OSD
4094 if(osd_level>=1 && sh_video){ 4094 if(osd_level>=1 && sh_video){
4238 vo_osd_changed(OSDTYPE_OSD); 4238 vo_osd_changed(OSDTYPE_OSD);
4239 osd_show_status--; 4239 osd_show_status--;
4240 } 4240 }
4241 // for(i=1;i<=11;i++) osd_text_buffer[10+i]=i;osd_text_buffer[10+i]=0; 4241 // for(i=1;i<=11;i++) osd_text_buffer[10+i]=i;osd_text_buffer[10+i]=0;
4242 // vo_osd_text=osd_text_buffer; 4242 // vo_osd_text=osd_text_buffer;
4243 #endif 4243 #endif /* USE_OSD */
4244 4244
4245 #ifdef USE_SUB 4245 #ifdef USE_SUB
4246 // find sub 4246 // find sub
4247 if(subdata && sh_video && sh_video->pts>0){ 4247 if(subdata && sh_video && sh_video->pts>0){
4248 float pts=sh_video->pts; 4248 float pts=sh_video->pts;