From eb7eb4bdde03d7a465bc8697fafd86092b7b6f7e Mon Sep 17 00:00:00 2001 From: arpi Date: Sun, 29 Sep 2002 19:26:40 +0000 Subject: some cleanup - made private vars/funcs static, removed obsolete externs git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7560 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_mpg.c | 2 -- libmpdemux/demuxer.c | 7 +++--- libmpdemux/open.c | 1 - mencoder.c | 58 +++++++++++++++++++++++++------------------------- mplayer.c | 56 +++++++++++++++++++++++++----------------------- mplayer.h | 7 ++++-- 6 files changed, 66 insertions(+), 65 deletions(-) diff --git a/libmpdemux/demux_mpg.c b/libmpdemux/demux_mpg.c index d2bf49baef..e808abd3d7 100644 --- a/libmpdemux/demux_mpg.c +++ b/libmpdemux/demux_mpg.c @@ -335,8 +335,6 @@ do{ return 1; } -//extern off_t seek_to_byte; - void demux_seek_mpg(demuxer_t *demuxer,float rel_seek_secs,int flags){ demux_stream_t *d_audio=demuxer->audio; demux_stream_t *d_video=demuxer->video; diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index 75eb81b99a..df5f33207c 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -496,13 +496,12 @@ extern int num_elementary_packets1B6; extern int num_mp3audio_packets; // commandline options, flags: -//extern int seek_to_byte; extern int force_ni; extern int pts_from_bps; -extern int audio_id; -extern int video_id; -extern int dvdsub_id; +//extern int audio_id; +//extern int video_id; +//extern int dvdsub_id; int asf_check_header(demuxer_t *demuxer); int read_asf_header(demuxer_t *demuxer); diff --git a/libmpdemux/open.c b/libmpdemux/open.c index 1caf6662d8..c0fff43920 100644 --- a/libmpdemux/open.c +++ b/libmpdemux/open.c @@ -110,7 +110,6 @@ if(vcd_track){ if(ret2<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_ErrTrackSelect " (get)\n");return NULL;} ret=vcd_seek_to_track(f,vcd_track); if(ret<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_ErrTrackSelect " (seek)\n");return NULL;} -// seek_to_byte+=ret; mp_msg(MSGT_OPEN,MSGL_V,"VCD start byte position: 0x%X end: 0x%X\n",ret,ret2); #ifdef __FreeBSD__ if (ioctl (f, CDRIOCSETBLOCKSIZE, &bsize) == -1) { diff --git a/mencoder.c b/mencoder.c index 4fa53ae217..d2ad95705c 100644 --- a/mencoder.c +++ b/mencoder.c @@ -20,8 +20,9 @@ #include #include "config.h" -#include "mp_msg.h" + #include "version.h" +#include "mp_msg.h" #include "help_mp.h" static char* banner_text= @@ -34,12 +35,13 @@ static char* banner_text= #include "codec-cfg.h" #include "cfgparser.h" -#include "stream.h" -#include "demuxer.h" -#include "stheader.h" -#include "playtree.h" +#include "libmpdemux/stream.h" +#include "libmpdemux/demuxer.h" +#include "libmpdemux/stheader.h" +#include "libmpdemux/mp3_hdr.h" +#include "libmpdemux/aviwrite.h" -#include "aviwrite.h" +#include "playtree.h" #include "libvo/video_out.h" @@ -48,8 +50,6 @@ static char* banner_text= #include "libmpcodecs/dec_video.h" #include "libmpcodecs/vf.h" -#include "libmpdemux/mp3_hdr.h" - // for MPEGLAYER3WAVEFORMAT: #include "loader/wine/mmreg.h" @@ -64,7 +64,7 @@ static char* banner_text= #include -#include "fastmemcpy.h" +#include "libvo/fastmemcpy.h" #include "linux/timer.h" @@ -87,17 +87,17 @@ int audio_id=-1; int video_id=-1; int dvdsub_id=-1; int vobsub_id=-1; -char* audio_lang=NULL; -char* dvdsub_lang=NULL; +static char* audio_lang=NULL; +static char* dvdsub_lang=NULL; static char* spudec_ifo=NULL; -char** audio_codec_list=NULL; // override audio codec -char** video_codec_list=NULL; // override video codec -char** audio_fm_list=NULL; // override audio codec family -char** video_fm_list=NULL; // override video codec family +static char** audio_codec_list=NULL; // override audio codec +static char** video_codec_list=NULL; // override video codec +static char** audio_fm_list=NULL; // override audio codec family +static char** video_fm_list=NULL; // override video codec family -int out_audio_codec=-1; -int out_video_codec=-1; +static int out_audio_codec=-1; +static int out_video_codec=-1; // audio stream skip/resync functions requires only for seeking. // (they should be implemented in the audio codec layer) @@ -119,15 +119,15 @@ static float default_max_pts_correction=-1;//0.01f; static float max_pts_correction=0;//default_max_pts_correction; static float c_total=0; -float audio_preload=0.5; -float audio_delay=0.0; -int audio_density=2; +static float audio_preload=0.5; +static float audio_delay=0.0; +static int audio_density=2; -float force_fps=0; -float force_ofps=0; // set to 24 for inverse telecine +static float force_fps=0; +static float force_ofps=0; // set to 24 for inverse telecine static int skip_limit=-1; -int force_srate=0; +static int force_srate=0; char *vobsub_out=NULL; unsigned int vobsub_out_index=0; @@ -189,7 +189,7 @@ int lame_param_ratio=-1; // unset float lame_param_scale=-1; // unset #endif -static int vo_w=0, vo_h=0; +//static int vo_w=0, vo_h=0; //-------------------------- config stuff: @@ -243,7 +243,7 @@ void parse_cfgfiles( m_config_t* conf ) //--------------------------------------------------------------------------- -int dec_audio(sh_audio_t *sh_audio,unsigned char* buffer,int total){ +static int dec_audio(sh_audio_t *sh_audio,unsigned char* buffer,int total){ int size=0; int at_eof=0; while(sizebih=malloc(sizeof(BITMAPINFOHEADER)); mux_v->bih->biSize=sizeof(BITMAPINFOHEADER); - mux_v->bih->biWidth=vo_w; - mux_v->bih->biHeight=vo_h; + mux_v->bih->biWidth=sh_video->disp_w; + mux_v->bih->biHeight=sh_video->disp_h; mux_v->bih->biPlanes=1; mux_v->bih->biBitCount=24; mux_v->bih->biCompression=mmioFOURCC('F','r','N','o'); diff --git a/mplayer.c b/mplayer.c index 1b781979ad..47694ad795 100644 --- a/mplayer.c +++ b/mplayer.c @@ -1,4 +1,4 @@ -// AVI & MPEG Player v0.18 (C) 2000-2001. by A'rpi/ESP-team +// Movie Player v0.90 (C) 2000-2002. by A'rpi/ESP-team & `cat AUTHORS` #include #include @@ -34,7 +34,7 @@ #endif #include "libvo/video_out.h" -extern void* mDisplay; // Display* mDisplay; +//extern void* mDisplay; // Display* mDisplay; #include "libvo/font_load.h" #include "libvo/sub.h" @@ -47,7 +47,10 @@ extern void* mDisplay; // Display* mDisplay; #include "codec-cfg.h" -#include "dvdauth.h" +#ifdef HAVE_LIBCSS +#include "libmpdemux/dvdauth.h" +#endif + #ifdef USE_DVDNAV #include #endif @@ -56,9 +59,9 @@ extern void* mDisplay; // Display* mDisplay; #include "vobsub.h" #include "linux/getch2.h" -#include "linux/keycodes.h" +//#include "linux/keycodes.h" #include "linux/timer.h" -#include "linux/shmem.h" +//#include "linux/shmem.h" #include "cpudetect.h" @@ -82,7 +85,6 @@ int quiet=0; #include "libmpdemux/tv.h" extern int tv_param_on; -//extern tvi_handle_t *tv_handler; #endif //**************************************************************************// @@ -124,10 +126,10 @@ static int cfg_include(struct config *conf, char *filename){ static int max_framesize=0; -#include "stream.h" -#include "demuxer.h" -#include "stheader.h" -#include "parse_es.h" +#include "libmpdemux/stream.h" +#include "libmpdemux/demuxer.h" +#include "libmpdemux/stheader.h" +//#include "parse_es.h" #include "libmpcodecs/dec_audio.h" #include "libmpcodecs/dec_video.h" @@ -153,8 +155,6 @@ static int total_frame_cnt=0; static int drop_frame_cnt=0; // total number of dropped frames int benchmark=0; -// static int play_in_bg=0; - // options: int auto_quality=0; static int output_quality=0; @@ -166,10 +166,12 @@ int osd_level_saved=-1; int osd_visible=100; // seek: -char *seek_to_sec=NULL; -off_t seek_to_byte=0; -off_t step_sec=0; -int loop_times=-1; +static char *seek_to_sec=NULL; +static off_t seek_to_byte=0; +static off_t step_sec=0; +static int loop_times=-1; + +// may be changed by GUI: (FIXME!) float rel_seek_secs=0; int abs_seek_pos=0; @@ -184,8 +186,8 @@ int audio_id=-1; int video_id=-1; int dvdsub_id=-1; int vobsub_id=-1; -char* audio_lang=NULL; -char* dvdsub_lang=NULL; +static char* audio_lang=NULL; +static char* dvdsub_lang=NULL; static char* spudec_ifo=NULL; int vcd_track=0; char* filename=NULL; //"MI2-Trailer.avi"; @@ -220,6 +222,9 @@ static int play_n_frames_mf=-1; char* video_driver=NULL; //"mga"; // default char* audio_driver=NULL; +extern char *vo_subdevice; +extern char *ao_subdevice; + // codec outfmt flags (defined in libmpcodecs/vd.c) extern int vo_flags; @@ -238,15 +243,12 @@ subtitle* subtitles=NULL; float sub_last_pts = -303; #endif -extern char *vo_subdevice; -extern char *ao_subdevice; - static stream_t* stream=NULL; - static demuxer_t *demuxer=NULL; char* current_module=NULL; // for debugging +// also modified by Gui/mplayer/gtk/eq.c: int vo_gamma_gamma = 1000; int vo_gamma_brightness = 1000; int vo_gamma_contrast = 1000; @@ -256,7 +258,7 @@ int vo_gamma_hue = 1000; // --- #ifdef HAVE_RTC -int nortc; +static int nortc; #endif static unsigned int inited_flags=0; @@ -272,7 +274,7 @@ static unsigned int inited_flags=0; #define INITED_DEMUXER 512 #define INITED_ALL 0xFFFF -void uninit_player(unsigned int mask){ +static void uninit_player(unsigned int mask){ mask=inited_flags&mask; mp_msg(MSGT_CPLAYER,MSGL_DBG2,"\n*** uninit(0x%X)\n",mask); @@ -362,7 +364,7 @@ void exit_player(char* how){ exit(1); } -void exit_sighandler(int x){ +static void exit_sighandler(int x){ static int sig_count=0; ++sig_count; if(sig_count==5 || (inited_flags==0 && sig_count>1)) exit(1); @@ -1234,8 +1236,8 @@ inited_flags|=INITED_VO; current_module="init_video_filters"; -sh_video->vfilter=vf_open_filter(NULL,"vo",video_out); -sh_video->vfilter=append_filters(sh_video->vfilter); +sh_video->vfilter=(void*)vf_open_filter(NULL,"vo",video_out); +sh_video->vfilter=(void*)append_filters(sh_video->vfilter); current_module="init_video_codec"; diff --git a/mplayer.h b/mplayer.h index 7a06f135aa..bd5b9e7ffa 100644 --- a/mplayer.h +++ b/mplayer.h @@ -7,7 +7,6 @@ extern int use_gui; extern char* current_module; -extern int fullscreen; extern int vcd_track; extern char ** audio_fm_list; @@ -35,9 +34,13 @@ extern subtitle* vo_sub; extern char * filename; extern int stream_cache_size; -extern int flip; extern int force_ni; extern int index_mode; + +// libmpcodecs: +extern int fullscreen; +extern int flip; + extern int frame_dropping; extern int auto_quality; -- cgit v1.2.3