comparison mplayer.c @ 18312:3b5b7e78b9af

Make EDL compilation unconditional
author uau
date Thu, 27 Apr 2006 12:40:29 +0000
parents 87161f96fa66
children 5646b8d9654c
comparison
equal deleted inserted replaced
18311:6727756ba981 18312:3b5b7e78b9af
69 69
70 #ifdef USE_DVDNAV 70 #ifdef USE_DVDNAV
71 #include <dvdnav.h> 71 #include <dvdnav.h>
72 #endif 72 #endif
73 73
74 #ifdef USE_EDL
75 #include "edl.h" 74 #include "edl.h"
76 #endif
77 75
78 #include "spudec.h" 76 #include "spudec.h"
79 #include "vobsub.h" 77 #include "vobsub.h"
80 78
81 #include "osdep/getch2.h" 79 #include "osdep/getch2.h"
393 #ifdef HAVE_RTC 391 #ifdef HAVE_RTC
394 static int nortc; 392 static int nortc;
395 static char* rtc_device; 393 static char* rtc_device;
396 #endif 394 #endif
397 395
398 #ifdef USE_EDL
399 edl_record_ptr edl_records = NULL; ///< EDL entries memory area 396 edl_record_ptr edl_records = NULL; ///< EDL entries memory area
400 edl_record_ptr next_edl_record = NULL; ///< only for traversing edl_records 397 edl_record_ptr next_edl_record = NULL; ///< only for traversing edl_records
401 short user_muted = 0; ///< Stores whether User wanted muted mode. 398 short user_muted = 0; ///< Stores whether User wanted muted mode.
402 short edl_muted = 0; ///< Stores whether EDL is currently in muted mode. 399 short edl_muted = 0; ///< Stores whether EDL is currently in muted mode.
403 short edl_decision = 0; ///< 1 when an EDL operation has been made 400 short edl_decision = 0; ///< 1 when an EDL operation has been made
404 FILE* edl_fd = NULL; ///< fd to write to when in -edlout mode 401 FILE* edl_fd = NULL; ///< fd to write to when in -edlout mode
405 #endif
406 402
407 static unsigned int inited_flags=0; 403 static unsigned int inited_flags=0;
408 #define INITED_VO 1 404 #define INITED_VO 1
409 #define INITED_AO 2 405 #define INITED_AO 2
410 #define INITED_GUI 4 406 #define INITED_GUI 4
540 536
541 if(playtree) 537 if(playtree)
542 play_tree_free(playtree, 1); 538 play_tree_free(playtree, 1);
543 539
544 540
545 #ifdef USE_EDL
546 if(edl_records != NULL) free(edl_records); // free mem allocated for EDL 541 if(edl_records != NULL) free(edl_records); // free mem allocated for EDL
547 #endif
548 if(how) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_ExitingHow,how); 542 if(how) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_ExitingHow,how);
549 mp_msg(MSGT_CPLAYER,MSGL_DBG2,"max framesize was %d bytes\n",max_framesize); 543 mp_msg(MSGT_CPLAYER,MSGL_DBG2,"max framesize was %d bytes\n",max_framesize);
550 544
551 exit(rc); 545 exit(rc);
552 } 546 }
1486 break; 1480 break;
1487 default: 1481 default:
1488 return M_PROPERTY_NOT_IMPLEMENTED; 1482 return M_PROPERTY_NOT_IMPLEMENTED;
1489 } 1483 }
1490 1484
1491 #ifdef USE_EDL
1492 if (edl_muted) return M_PROPERTY_DISABLED; 1485 if (edl_muted) return M_PROPERTY_DISABLED;
1493 user_muted = 0; 1486 user_muted = 0;
1494 #endif
1495 1487
1496 switch(action) { 1488 switch(action) {
1497 case M_PROPERTY_SET: 1489 case M_PROPERTY_SET:
1498 if(!arg) return 0; 1490 if(!arg) return 0;
1499 M_PROPERTY_CLAMP(prop,*(float*)arg); 1491 M_PROPERTY_CLAMP(prop,*(float*)arg);
1520 1512
1521 if(!sh_audio) return M_PROPERTY_UNAVAILABLE; 1513 if(!sh_audio) return M_PROPERTY_UNAVAILABLE;
1522 1514
1523 switch(action) { 1515 switch(action) {
1524 case M_PROPERTY_SET: 1516 case M_PROPERTY_SET:
1525 #ifdef USE_EDL
1526 if(edl_muted) return M_PROPERTY_DISABLED; 1517 if(edl_muted) return M_PROPERTY_DISABLED;
1527 #endif
1528 if(!arg) return 0; 1518 if(!arg) return 0;
1529 if((!!*(int*)arg) != mixer.muted) 1519 if((!!*(int*)arg) != mixer.muted)
1530 mixer_mute(&mixer); 1520 mixer_mute(&mixer);
1531 return 1; 1521 return 1;
1532 case M_PROPERTY_STEP_UP: 1522 case M_PROPERTY_STEP_UP:
1533 case M_PROPERTY_STEP_DOWN: 1523 case M_PROPERTY_STEP_DOWN:
1534 #ifdef USE_EDL
1535 if(edl_muted) return M_PROPERTY_DISABLED; 1524 if(edl_muted) return M_PROPERTY_DISABLED;
1536 #endif
1537 mixer_mute(&mixer); 1525 mixer_mute(&mixer);
1538 return 1; 1526 return 1;
1539 case M_PROPERTY_PRINT: 1527 case M_PROPERTY_PRINT:
1540 if(!arg) return 0; 1528 if(!arg) return 0;
1541 #ifdef USE_EDL
1542 if(edl_muted) { 1529 if(edl_muted) {
1543 *(char**)arg = strdup(MSGTR_EnabledEdl); 1530 *(char**)arg = strdup(MSGTR_EnabledEdl);
1544 return 1; 1531 return 1;
1545 } 1532 }
1546 #endif
1547 default: 1533 default:
1548 return m_property_flag(prop,action,arg,&mixer.muted); 1534 return m_property_flag(prop,action,arg,&mixer.muted);
1549 1535
1550 } 1536 }
1551 } 1537 }
2867 } 2853 }
2868 //--------------------------------------------------------------------------- 2854 //---------------------------------------------------------------------------
2869 2855
2870 if(filename) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_Playing, filename); 2856 if(filename) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_Playing, filename);
2871 2857
2872 #ifdef USE_EDL
2873 if (edl_filename) { 2858 if (edl_filename) {
2874 if (edl_records) free_edl(edl_records); 2859 if (edl_records) free_edl(edl_records);
2875 next_edl_record = edl_records = edl_parse_file(); 2860 next_edl_record = edl_records = edl_parse_file();
2876 } 2861 }
2877 if (edl_output_filename) { 2862 if (edl_output_filename) {
2880 { 2865 {
2881 mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlCantOpenForWrite, 2866 mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlCantOpenForWrite,
2882 edl_output_filename); 2867 edl_output_filename);
2883 } 2868 }
2884 } 2869 }
2885 #endif
2886 2870
2887 //==================== Open VOB-Sub ============================ 2871 //==================== Open VOB-Sub ============================
2888 2872
2889 current_module="vobsub"; 2873 current_module="vobsub";
2890 if (vobsub_name){ 2874 if (vobsub_name){
4135 dvdnav_stream_sleeping((dvdnav_priv_t*)stream->priv); 4119 dvdnav_stream_sleeping((dvdnav_priv_t*)stream->priv);
4136 #endif 4120 #endif
4137 4121
4138 //================= EDL ========================================= 4122 //================= EDL =========================================
4139 4123
4140 #ifdef USE_EDL
4141 if( next_edl_record ) { // Are we (still?) doing EDL? 4124 if( next_edl_record ) { // Are we (still?) doing EDL?
4142 if ( !sh_video ) { 4125 if ( !sh_video ) {
4143 mp_msg( MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlNOsh_video ); 4126 mp_msg( MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlNOsh_video );
4144 free_edl(edl_records); 4127 free_edl(edl_records);
4145 next_edl_record = NULL; 4128 next_edl_record = NULL;
4159 } 4142 }
4160 next_edl_record=next_edl_record->next; 4143 next_edl_record=next_edl_record->next;
4161 } 4144 }
4162 } 4145 }
4163 } 4146 }
4164 #endif
4165 4147
4166 //================= Keyboard events, SEEKing ==================== 4148 //================= Keyboard events, SEEKing ====================
4167 4149
4168 current_module="key_events"; 4150 current_module="key_events";
4169 4151
4225 break; 4207 break;
4226 } 4208 }
4227 mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_%s=%s\n",cmd->args[0].v.s,tmp); 4209 mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_%s=%s\n",cmd->args[0].v.s,tmp);
4228 free(tmp); 4210 free(tmp);
4229 } break; 4211 } break;
4230 #ifdef USE_EDL
4231 case MP_CMD_EDL_MARK: 4212 case MP_CMD_EDL_MARK:
4232 if( edl_fd ) { 4213 if( edl_fd ) {
4233 float v = sh_video->pts; 4214 float v = sh_video->pts;
4234 fprintf( edl_fd, "%f %f %d\n", v-2, v, 0 ); 4215 fprintf( edl_fd, "%f %f %d\n", v-2, v, 0 );
4235 } 4216 }
4236 break; 4217 break;
4237 #endif
4238 case MP_CMD_SWITCH_RATIO : { 4218 case MP_CMD_SWITCH_RATIO : {
4239 if (cmd->nargs == 0) 4219 if (cmd->nargs == 0)
4240 movie_aspect = (float) sh_video->disp_w / sh_video->disp_h; 4220 movie_aspect = (float) sh_video->disp_w / sh_video->disp_h;
4241 else 4221 else
4242 movie_aspect = cmd->args[0].v.f; 4222 movie_aspect = cmd->args[0].v.f;
4916 sh_audio->a_buffer_len = 0; 4896 sh_audio->a_buffer_len = 0;
4917 sh_audio->a_out_buffer_len = 0; 4897 sh_audio->a_out_buffer_len = 0;
4918 } 4898 }
4919 // Set OSD: 4899 // Set OSD:
4920 if(!loop_seek){ 4900 if(!loop_seek){
4921 #ifdef USE_EDL
4922 if( !edl_decision ) 4901 if( !edl_decision )
4923 #endif
4924 set_osd_bar(0,"Position",0,100,demuxer_get_percent_pos(demuxer)); 4902 set_osd_bar(0,"Position",0,100,demuxer_get_percent_pos(demuxer));
4925 } 4903 }
4926 4904
4927 if(sh_video) { 4905 if(sh_video) {
4928 c_total=0; 4906 c_total=0;
4934 too_fast_frame_cnt=0; 4912 too_fast_frame_cnt=0;
4935 4913
4936 if(vo_spudec) spudec_reset(vo_spudec); 4914 if(vo_spudec) spudec_reset(vo_spudec);
4937 } 4915 }
4938 } 4916 }
4939 #ifdef USE_EDL
4940 /* 4917 /*
4941 * We saw a seek, have to rewind the EDL operations stack 4918 * We saw a seek, have to rewind the EDL operations stack
4942 * and find the next EDL action to take care of. 4919 * and find the next EDL action to take care of.
4943 */ 4920 */
4944 4921
4957 if (next_edl_record->action == EDL_MUTE) edl_muted = !edl_muted; 4934 if (next_edl_record->action == EDL_MUTE) edl_muted = !edl_muted;
4958 next_edl_record = next_edl_record->next; 4935 next_edl_record = next_edl_record->next;
4959 4936
4960 } 4937 }
4961 if ((user_muted | edl_muted) != mixer.muted) mixer_mute(&mixer); 4938 if ((user_muted | edl_muted) != mixer.muted) mixer_mute(&mixer);
4962 #endif 4939
4963 rel_seek_secs=0; 4940 rel_seek_secs=0;
4964 abs_seek_pos=0; 4941 abs_seek_pos=0;
4965 frame_time_remaining=0; 4942 frame_time_remaining=0;
4966 current_module=NULL; 4943 current_module=NULL;
4967 loop_seek=0; 4944 loop_seek=0;