diff -ubr ../MPlayer-20020824/mplayer.c ./mplayer.c --- ../MPlayer-20020824/mplayer.c Thu Aug 22 17:30:31 2002 +++ ./mplayer.c Mon Aug 26 23:52:47 2002 @@ -1607,11 +1607,26 @@ #if 0 { // debug frame dropping code + float length; float delay=audio_out->get_delay(); - mp_msg(MSGT_AVSYNC,MSGL_V,"\r[V] %5.3f [A] %5.3f => {%5.3f} (%5.3f) [%d] \n", + + // ------------------------------------------------------------------ + // comput file length in second... added by j.a.l@free.fr by simple copy/paste of code few lines further... + if(demuxer->file_format==DEMUXER_TYPE_AVI && sh_video->video.dwLength>2){ + // get pos from frame number / total frames + length = (float)d_video->pack_no*100.0f/sh_video->video.dwLength; + } else { + // get pos from file position / filesize + int len=((demuxer->movi_end-demuxer->movi_start)); + int pos=(demuxer->file_format==DEMUXER_TYPE_AVI)?demuxer->filepos:d_video->pos; + + length=(len<=0)?0:((float)(pos-demuxer->movi_start) / len * 100.0f); + } + + mp_msg(MSGT_AVSYNC,MSGL_V,"\r[V] %5.3f [A] %5.3f => {%5.3f} (%5.3f) [%d] percent %f\n", sh_video->timer,sh_audio->timer-delay, sh_video->timer-(sh_audio->timer-delay), - delay,drop_frame); + delay,drop_frame, length); } #endif @@ -1818,8 +1833,25 @@ else max_pts_correction=sh_video->frametime*0.10; // +-10% of time if(!frame_time_remaining){ sh_audio->timer+=x; c_total+=x;} // correction - if(!quiet) 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 %d %d%%\r", - a_pts-audio_delay-delay,v_pts,AV_delay,c_total, + + if(!quiet) + { float length; + + // ------------------------------------------------------------------ + // comput file length in second... added by j.a.l@free.fr by simple copy/paste of code few lines further... + if(demuxer->file_format==DEMUXER_TYPE_AVI && sh_video->video.dwLength>2){ + // get pos from frame number / total frames + length = (float)d_video->pack_no*100.0f/sh_video->video.dwLength; + } else { + // get pos from file position / filesize + int len=((demuxer->movi_end-demuxer->movi_start)); + int pos=(demuxer->file_format==DEMUXER_TYPE_AVI)?demuxer->filepos:d_video->pos; + + length=(len<=0)?0:((float)(pos-demuxer->movi_start) / len * 100.0f); + } + + mp_msg(MSGT_AVSYNC,MSGL_STATUS,"A:%6.2f V:%6.2f %%:%3.2f A-V:%7.3f ct:%7.3f %3d/%3d %2d%% %2d%% %4.1f%% %d %d %d%%\r", + a_pts-audio_delay-delay,v_pts,length,AV_delay,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, @@ -1828,6 +1860,8 @@ ,output_quality ,cache_fill_status ); + } + fflush(stdout); } @@ -1835,7 +1869,21 @@ // No audio: if(!quiet) - mp_msg(MSGT_AVSYNC,MSGL_STATUS,"V:%6.1f %3d %2d%% %2d%% %4.1f%% %d %d %d%%\r",d_video->pts, + { float length; + // ------------------------------------------------------------------ + // comput file length in second... added by j.a.l@free.fr by simple copy/paste of code few lines further... + if(demuxer->file_format==DEMUXER_TYPE_AVI && sh_video->video.dwLength>2){ + // get pos from frame number / total frames + length = (float)d_video->pack_no*100.0f/sh_video->video.dwLength; + } else { + // get pos from file position / filesize + int len=((demuxer->movi_end-demuxer->movi_start)); + int pos=(demuxer->file_format==DEMUXER_TYPE_AVI)?demuxer->filepos:d_video->pos; + + length=(len<=0)?0:((float)(pos-demuxer->movi_start) / len * 100.0f); + } + + mp_msg(MSGT_AVSYNC,MSGL_STATUS,"V:%6.2f %%:%3.2f %3d %2d%% %2d%% %4.1f%% %d %d %d%%\r",d_video->pts,length, (int)sh_video->num_frames, (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, @@ -1844,6 +1892,7 @@ ,output_quality ,cache_fill_status ); + } fflush(stdout);