comparison mencoder.c @ 27341:e7c989f7a7c9

Start unifying names of internal preprocessor directives. Replace all USE_ prefixes by CONFIG_ prefixes to indicate options which are configurable.
author diego
date Wed, 30 Jul 2008 12:01:30 +0000
parents 5e0e6d992c7f
children 1d2faa1020fb
comparison
equal deleted inserted replaced
27340:33274ce3cce0 27341:e7c989f7a7c9
75 75
76 #include "libvo/fastmemcpy.h" 76 #include "libvo/fastmemcpy.h"
77 77
78 #include "osdep/timer.h" 78 #include "osdep/timer.h"
79 79
80 #ifdef USE_DVDREAD 80 #ifdef CONFIG_DVDREAD
81 #include "stream/stream_dvd.h" 81 #include "stream/stream_dvd.h"
82 #endif 82 #endif
83 83
84 #ifdef USE_DVDNAV 84 #ifdef CONFIG_DVDNAV
85 #include "stream/stream_dvdnav.h" 85 #include "stream/stream_dvdnav.h"
86 #endif 86 #endif
87 87
88 #ifdef USE_LIBAVCODEC 88 #ifdef CONFIG_LIBAVCODEC
89 #include "libavcodec/avcodec.h" 89 #include "libavcodec/avcodec.h"
90 #endif 90 #endif
91 91
92 #include "libmpcodecs/ae.h" 92 #include "libmpcodecs/ae.h"
93 int vo_doublebuffering=0; 93 int vo_doublebuffering=0;
97 97
98 //-------------------------- 98 //--------------------------
99 99
100 // cache2: 100 // cache2:
101 int stream_cache_size=-1; 101 int stream_cache_size=-1;
102 #ifdef USE_STREAM_CACHE 102 #ifdef CONFIG_STREAM_CACHE
103 extern int cache_fill_status; 103 extern int cache_fill_status;
104 104
105 float stream_cache_min_percent=20.0; 105 float stream_cache_min_percent=20.0;
106 float stream_cache_seek_min_percent=50.0; 106 float stream_cache_seek_min_percent=50.0;
107 #else 107 #else
222 // Needed by getch2 222 // Needed by getch2
223 void mplayer_put_key(int code) 223 void mplayer_put_key(int code)
224 { 224 {
225 } 225 }
226 226
227 #ifdef USE_ASS 227 #ifdef CONFIG_ASS
228 #include "libass/ass.h" 228 #include "libass/ass.h"
229 #include "libass/ass_mp.h" 229 #include "libass/ass_mp.h"
230 #endif 230 #endif
231 char *current_module; 231 char *current_module;
232 #include "mpcommon.h" 232 #include "mpcommon.h"
289 */ 289 */
290 static int edl_seek(edl_record_ptr next_edl_record, demuxer_t* demuxer, demux_stream_t *d_audio, muxer_stream_t* mux_a, s_frame_data * frame_data, int framecopy); 290 static int edl_seek(edl_record_ptr next_edl_record, demuxer_t* demuxer, demux_stream_t *d_audio, muxer_stream_t* mux_a, s_frame_data * frame_data, int framecopy);
291 291
292 #include "cfg-mencoder.h" 292 #include "cfg-mencoder.h"
293 293
294 #ifdef USE_DVDREAD 294 #ifdef CONFIG_DVDREAD
295 #include "spudec.h" 295 #include "spudec.h"
296 #endif 296 #endif
297 #include "vobsub.h" 297 #include "vobsub.h"
298 298
299 #include "libao2/audio_out.h" 299 #include "libao2/audio_out.h"
454 #endif 454 #endif
455 mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n\n"); 455 mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n\n");
456 #endif 456 #endif
457 #endif 457 #endif
458 458
459 #if defined(WIN32) && defined(USE_WIN32DLL) 459 #if defined(WIN32) && defined(CONFIG_WIN32DLL)
460 set_path_env(); 460 set_path_env();
461 #endif /*WIN32 && USE_WIN32DLL*/ 461 #endif /*WIN32 && CONFIG_WIN32DLL*/
462 462
463 InitTimer(); 463 InitTimer();
464 464
465 // check codec.conf 465 // check codec.conf
466 if(!codecs_file || !parse_codec_cfg(codecs_file)){ 466 if(!codecs_file || !parse_codec_cfg(codecs_file)){
573 mencoder_exit(1,NULL); 573 mencoder_exit(1,NULL);
574 } 574 }
575 575
576 mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_OpenedStream, file_format, (int)(stream->start_pos), (int)(stream->end_pos)); 576 mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_OpenedStream, file_format, (int)(stream->start_pos), (int)(stream->end_pos));
577 577
578 #ifdef USE_DVDREAD 578 #ifdef CONFIG_DVDREAD
579 if(stream->type==STREAMTYPE_DVD){ 579 if(stream->type==STREAMTYPE_DVD){
580 if(audio_lang && audio_id==-1) audio_id=dvd_aid_from_lang(stream,audio_lang); 580 if(audio_lang && audio_id==-1) audio_id=dvd_aid_from_lang(stream,audio_lang);
581 if(dvdsub_lang && dvdsub_id==-2) dvdsub_id=dvd_sid_from_lang(stream,dvdsub_lang); 581 if(dvdsub_lang && dvdsub_id==-2) dvdsub_id=dvd_sid_from_lang(stream,dvdsub_lang);
582 } 582 }
583 #endif 583 #endif
584 584
585 #ifdef USE_DVDNAV 585 #ifdef CONFIG_DVDNAV
586 if(stream->type==STREAMTYPE_DVDNAV){ 586 if(stream->type==STREAMTYPE_DVDNAV){
587 if(audio_lang && audio_id==-1) audio_id=mp_dvdnav_aid_from_lang(stream,audio_lang); 587 if(audio_lang && audio_id==-1) audio_id=mp_dvdnav_aid_from_lang(stream,audio_lang);
588 if(dvdsub_lang && dvdsub_id==-2) dvdsub_id=mp_dvdnav_sid_from_lang(stream,dvdsub_lang); 588 if(dvdsub_lang && dvdsub_id==-2) dvdsub_id=mp_dvdnav_sid_from_lang(stream,dvdsub_lang);
589 } 589 }
590 #endif 590 #endif
712 unsigned int palette[16], width, height; 712 unsigned int palette[16], width, height;
713 unsigned char tmp[3] = { 0, 0, 0 }; 713 unsigned char tmp[3] = { 0, 0, 0 };
714 if (spudec_ifo && vobsub_parse_ifo(NULL,spudec_ifo, palette, &width, &height, 1, dvdsub_id, tmp) >= 0) 714 if (spudec_ifo && vobsub_parse_ifo(NULL,spudec_ifo, palette, &width, &height, 1, dvdsub_id, tmp) >= 0)
715 vobsub_writer = vobsub_out_open(vobsub_out, palette, sh_video->disp_w, sh_video->disp_h, 715 vobsub_writer = vobsub_out_open(vobsub_out, palette, sh_video->disp_w, sh_video->disp_h,
716 vobsub_out_id?vobsub_out_id:(char *)tmp, vobsub_out_index); 716 vobsub_out_id?vobsub_out_id:(char *)tmp, vobsub_out_index);
717 #ifdef USE_DVDREAD 717 #ifdef CONFIG_DVDREAD
718 if (vobsub_writer == NULL) { 718 if (vobsub_writer == NULL) {
719 char tmp[3]; 719 char tmp[3];
720 if (vobsub_out_id == NULL && stream->type == STREAMTYPE_DVD) { 720 if (vobsub_out_id == NULL && stream->type == STREAMTYPE_DVD) {
721 int i; 721 int i;
722 dvd_priv_t *dvd = (dvd_priv_t*)stream->priv; 722 dvd_priv_t *dvd = (dvd_priv_t*)stream->priv;
738 if (spudec_ifo) { 738 if (spudec_ifo) {
739 unsigned int palette[16], width, height; 739 unsigned int palette[16], width, height;
740 if (vobsub_parse_ifo(NULL,spudec_ifo, palette, &width, &height, 1, -1, NULL) >= 0) 740 if (vobsub_parse_ifo(NULL,spudec_ifo, palette, &width, &height, 1, -1, NULL) >= 0)
741 vo_spudec=spudec_new_scaled(palette, sh_video->disp_w, sh_video->disp_h); 741 vo_spudec=spudec_new_scaled(palette, sh_video->disp_w, sh_video->disp_h);
742 } 742 }
743 #ifdef USE_DVDREAD 743 #ifdef CONFIG_DVDREAD
744 if (vo_spudec==NULL) { 744 if (vo_spudec==NULL) {
745 vo_spudec=spudec_new_scaled(stream->type==STREAMTYPE_DVD?((dvd_priv_t *)(stream->priv))->cur_pgc->palette:NULL, 745 vo_spudec=spudec_new_scaled(stream->type==STREAMTYPE_DVD?((dvd_priv_t *)(stream->priv))->cur_pgc->palette:NULL,
746 sh_video->disp_w, sh_video->disp_h); 746 sh_video->disp_w, sh_video->disp_h);
747 } 747 }
748 #endif 748 #endif
777 mux_v->buffer=malloc(mux_v->buffer_size); 777 mux_v->buffer=malloc(mux_v->buffer_size);
778 778
779 mux_v->source=sh_video; 779 mux_v->source=sh_video;
780 780
781 mux_v->h.dwSampleSize=0; // VBR 781 mux_v->h.dwSampleSize=0; // VBR
782 #ifdef USE_LIBAVCODEC 782 #ifdef CONFIG_LIBAVCODEC
783 { 783 {
784 double fps = force_ofps?force_ofps:sh_video->fps*playback_speed; 784 double fps = force_ofps?force_ofps:sh_video->fps*playback_speed;
785 AVRational q= av_d2q(fps, fps*1001+2); 785 AVRational q= av_d2q(fps, fps*1001+2);
786 mux_v->h.dwScale= q.den; 786 mux_v->h.dwScale= q.den;
787 mux_v->h.dwRate = q.num; 787 mux_v->h.dwRate = q.num;
1497 } 1497 }
1498 #endif 1498 #endif
1499 } 1499 }
1500 fflush(stdout); 1500 fflush(stdout);
1501 1501
1502 #ifdef USE_DVDREAD 1502 #ifdef CONFIG_DVDREAD
1503 // DVD sub: 1503 // DVD sub:
1504 if(vobsub_writer){ 1504 if(vobsub_writer){
1505 unsigned char* packet=NULL; 1505 unsigned char* packet=NULL;
1506 int len; 1506 int len;
1507 while((len=ds_get_packet_sub(d_dvdsub,&packet))>0){ 1507 while((len=ds_get_packet_sub(d_dvdsub,&packet))>0){