From 0e8f7d0e58696c11bf8c5ce95e8bfd3a10652343 Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 16 Mar 2010 12:24:18 +0000 Subject: Remove unnecessary forward declarations for a bunch of functions. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30909 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mencoder.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'mencoder.c') diff --git a/mencoder.c b/mencoder.c index 104db38860..2e148503cc 100644 --- a/mencoder.c +++ b/mencoder.c @@ -274,29 +274,12 @@ typedef struct { int already_read; } s_frame_data; -/// Returns a_pts -static float calc_a_pts(demux_stream_t *d_audio); -/** \brief Seeks audio forward to pts by dumping audio packets - \return The current audio pts. -*/ -static float forward_audio(float pts, demux_stream_t *d_audio, muxer_stream_t* mux_a); -/** \brief Seeks slowly by dumping frames. - \return 1 for success, 2 for EOF. -*/ -static int slowseek(float end_pts, demux_stream_t *d_video, demux_stream_t *d_audio, muxer_stream_t* mux_a, s_frame_data * frame_data, int framecopy, int print_info); -/// Deletes audio or video as told by -delay to sync -static void fixdelay(demux_stream_t *d_video, demux_stream_t *d_audio, muxer_stream_t* mux_a, s_frame_data * frame_data, int framecopy); - #include "edl.h" static edl_record_ptr edl_records = NULL; ///< EDL entries memory area static edl_record_ptr next_edl_record = NULL; ///< only for traversing edl_records static short edl_muted; ///< Stores whether EDL is currently in muted mode. static short edl_seeking; ///< When non-zero, stream is seekable. static short edl_seek_type; ///< When non-zero, frames are discarded instead of seeking. -/** \brief Seeks for EDL - \return 1 for success, 0 for failure, 2 for EOF. -*/ -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); #include "cfg-mencoder.h" @@ -354,10 +337,6 @@ static int dec_audio(sh_audio_t *sh_audio,unsigned char* buffer,int total){ //--------------------------------------------------------------------------- -// this function returns the absoloute time for which MEncoder will switch files or move in the file. -// so audio can be cut correctly. -1 if there is no limit. -static float stop_time(demuxer_t* demuxer, muxer_stream_t* mux_v); - static volatile int at_eof=0; static volatile int interrupted=0; @@ -406,6 +385,8 @@ void add_subtitles(char *filename, float fps, int silent) subdata = subd; } +/* This function returns the absolute time for which MEncoder will switch files + * or move in the file so audio can be cut correctly. -1 if there is no limit. */ static float stop_time(demuxer_t* demuxer, muxer_stream_t* mux_v) { float timeleft = -1; @@ -426,6 +407,7 @@ static float stop_time(demuxer_t* demuxer, muxer_stream_t* mux_v) return timeleft; } +/// Returns a_pts static float calc_a_pts(demux_stream_t *d_audio) { sh_audio_t * sh_audio = d_audio ? d_audio->sh : NULL; @@ -435,6 +417,8 @@ static float calc_a_pts(demux_stream_t *d_audio) return a_pts; } +/** \brief Seeks audio forward to pts by dumping audio packets + * \return The current audio pts. */ static float forward_audio(float pts, demux_stream_t *d_audio, muxer_stream_t* mux_a) { sh_audio_t * sh_audio = d_audio ? d_audio->sh : NULL; @@ -471,6 +455,8 @@ static float forward_audio(float pts, demux_stream_t *d_audio, muxer_stream_t* m return a_pts; } +/** \brief Seeks slowly by dumping frames. + * \return 1 for success, 2 for EOF. */ static int slowseek(float end_pts, demux_stream_t *d_video, demux_stream_t *d_audio, muxer_stream_t *mux_a, s_frame_data *frame_data, int framecopy, int print_info) @@ -516,6 +502,7 @@ static int slowseek(float end_pts, demux_stream_t *d_video, return 1; } +/// Deletes audio or video as told by -delay to sync static void fixdelay(demux_stream_t *d_video, demux_stream_t *d_audio, muxer_stream_t *mux_a, s_frame_data *frame_data, int framecopy) @@ -540,6 +527,8 @@ static void fixdelay(demux_stream_t *d_video, demux_stream_t *d_audio, slowseek(a_pts - audio_delay, d_video, d_audio, mux_a, frame_data, framecopy, 0); } +/** \brief Seeks for EDL + * \return 1 for success, 0 for failure, 2 for EOF. */ 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) -- cgit v1.2.3 From c19c71be2b6707c66e9216563f48bc7a6580e5ac Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 16 Mar 2010 12:38:29 +0000 Subject: Remove some commented-out debugging and similar cruft. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30910 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mencoder.c | 45 --------------------------------------------- 1 file changed, 45 deletions(-) (limited to 'mencoder.c') diff --git a/mencoder.c b/mencoder.c index 2e148503cc..e98015a90b 100644 --- a/mencoder.c +++ b/mencoder.c @@ -138,12 +138,6 @@ static int out_audio_codec=-1; static int out_video_codec=-1; int out_file_format=MUXER_TYPE_AVI; // default to AVI - -// audio stream skip/resync functions requires only for seeking. -// (they should be implemented in the audio codec layer) -//void skip_audio_frame(sh_audio_t *sh_audio){} -//void resync_audio_stream(sh_audio_t *sh_audio){} - int quiet=0; double video_time_usage=0; double vout_time_usage=0; @@ -242,14 +236,6 @@ void set_osd_subtitle(subtitle *subs) { vo_osd_changed(OSDTYPE_SUBTITLE); } -//char *out_audio_codec=NULL; // override audio codec -//char *out_video_codec=NULL; // override video codec - -//#include "libmpeg2/mpeg2.h" -//#include "libmpeg2/mpeg2_internal.h" - -//static int vo_w=0, vo_h=0; - //-------------------------- config stuff: m_config_t* mconfig; @@ -755,7 +741,6 @@ if(stream->type==STREAMTYPE_DVDNAV){ if(demuxer2) audio_id=-2; /* do NOT read audio packets... */ - //demuxer=demux_open(stream,file_format,video_id,audio_id,dvdsub_id); demuxer=demux_open(stream,file_format,audio_id,video_id,dvdsub_id,filename); if(!demuxer){ mp_msg(MSGT_DEMUXER, MSGL_FATAL, MSGTR_FormatNotRecognized); @@ -1499,7 +1484,6 @@ if(demuxer2){ // 3-pass encoding, read control file (frameno.avi) if(len==4) next_frameno=start[0]; } if(at_eof) break; - // if(skip_flag) printf("!!!!!!!!!!!!\n"); skip_flag=next_frameno-decoded_frameno; // find next frame: while(next_frameno<=decoded_frameno){ @@ -1509,13 +1493,10 @@ if(demuxer2){ // 3-pass encoding, read control file (frameno.avi) if(len==0) --skip_flag; else // duplicate if(len==4) next_frameno=start[0]; } -// if(at_eof) break; -// printf("Current fno=%d requested=%d skip=%d \n",decoded_frameno,fno,skip_flag); } else { // check frame duplicate/drop: -//printf("\r### %5.3f ###\n",v_timer_corr); float mux_frametime = (float)mux_v->h.dwScale/mux_v->h.dwRate; if (v_timer_corr >= mux_frametime && (skip_limit<0 || skip_flag < skip_limit)) { @@ -1616,7 +1597,6 @@ if(sh_audio && !demuxer2){ unsigned int samples=(sh_audio->audio.dwSampleSize)? ((ds_tell(d_audio)-sh_audio->a_in_buffer_len)/sh_audio->audio.dwSampleSize) : (d_audio->block_no); // <- used for VBR audio -// printf("samples=%d \n",samples); a_pts=samples*(float)sh_audio->audio.dwScale/(float)sh_audio->audio.dwRate; delay_corrected=1; } else @@ -1625,7 +1605,6 @@ if(sh_audio && !demuxer2){ // PTS = (last timestamp) + (bytes after last timestamp)/(bytes per sec) a_pts=d_audio->pts; if(!delay_corrected) if(a_pts) delay_corrected=1; - //printf("*** %5.3f ***\n",a_pts); a_pts+=(ds_tell_pts(d_audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps; } v_pts=sh_video ? sh_video->pts : d_video->pts; @@ -1650,23 +1629,6 @@ if(sh_audio && !demuxer2){ v_pts_corr+=x; } -// printf("A:%6.1f V:%6.1f A-V:%7.3f oAV:%7.3f diff:%7.3f ct:%7.3f vpc:%7.3f \r", -// a_pts,v_pts,a_pts-v_pts, -// (float)(mux_a->timer-mux_v->timer), -// AV_delay, c_total, v_pts_corr ); -// printf("V:%6.1f \r", d_video->pts ); - -#if 0 - mp_msg(MSGT_AVSYNC,MSGL_STATUS,"A:%6.1f V:%6.1f A-V:%7.3f ct:%7.3f %3d/%3d %2d%% %2d%% %4.1f%% %d%%\r", - a_pts,v_pts,a_pts-v_pts,c_total, - (int)sh_video->num_frames,(int)sh_video->num_frames_decoded, - (sh_video->timer>0.5)?(int)(100.0*video_time_usage/(double)sh_video->timer):0, - (sh_video->timer>0.5)?(int)(100.0*vout_time_usage/(double)sh_video->timer):0, - (sh_video->timer>0.5)?(100.0*audio_time_usage/(double)sh_video->timer):0 - ,cache_fill_status - ); -#endif - { float t=(GetTimerMS()-timer_start)*0.001f; float len=(demuxer->movi_end-demuxer->movi_start); off_t pos = demuxer->filepos >= 0 ? demuxer->filepos : stream_tell(demuxer->stream); @@ -1678,12 +1640,6 @@ if(sh_audio && !demuxer2){ / (float)(sh_audio->audio.dwLength); } #endif -#if 0 - mp_msg(MSGT_AVSYNC,MSGL_STATUS,"%d < %d < %d \r", - (int)demuxer->movi_start, - (int)demuxer->filepos, - (int)demuxer->movi_end); -#else if(!quiet) { if( mp_msg_test(MSGT_STATUSLINE,MSGL_V) ) { mp_msg(MSGT_STATUSLINE,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %3dfps Trem:%4dmin %3dmb A-V:%5.3f [%d:%d] A/Vms %d/%d D/B/S %d/%d/%d \r", @@ -1708,7 +1664,6 @@ if(sh_audio && !demuxer2){ (mux_a && mux_a->timer>1) ? (int)(mux_a->size/mux_a->timer/125) : 0 ); } -#endif } fflush(stdout); -- cgit v1.2.3 From 11eeaf5005b64a49d7338303610a01d0b2d4f955 Mon Sep 17 00:00:00 2001 From: komh Date: Wed, 17 Mar 2010 09:12:51 +0000 Subject: Follow a more proper way to support -codecpath. 1. Include loader/drv.h for SetCodecPath() instead of a declaration of it. 2. Move codec_path from get_path.h to mpcommon.h and mpcommon.c. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30914 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mencoder.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mencoder.c') diff --git a/mencoder.c b/mencoder.c index e98015a90b..9d4450f9ba 100644 --- a/mencoder.c +++ b/mencoder.c @@ -65,6 +65,10 @@ #include "mp_fifo.h" #include "get_path.h" +#ifdef CONFIG_WIN32DLL +#include "loader/drv.h" // for SetCodecPath() +#endif + #include "stream/stream.h" #include "libmpdemux/aviprint.h" #include "libmpdemux/demuxer.h" -- cgit v1.2.3