patches/mplayer-1.0cvs20070302-slavemode.diff
branchtrunk
changeset 0 474a1293c3c0
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/mplayer-1.0cvs20070302-slavemode.diff	Sat Dec 29 14:47:40 2007 +0100
     1.3 @@ -0,0 +1,28 @@
     1.4 +--- mplayer/mplayer.c.orig	2007-03-02 13:20:05.000000000 -0800
     1.5 ++++ mplayer/mplayer.c	2007-03-02 13:20:39.000000000 -0800
     1.6 +@@ -3549,6 +3549,25 @@
     1.7 +   edl_decision = 0;
     1.8 + }
     1.9 + 
    1.10 ++#if 1
    1.11 ++  if(slave_mode){
    1.12 ++    float position=0.0;
    1.13 ++    float time=0.0;
    1.14 ++    if(mpctx->demuxer->file_format==DEMUXER_TYPE_AVI && mpctx->sh_video->video.dwLength>2) {
    1.15 ++      // get pos from frame number / total frames
    1.16 ++      position=(float)mpctx->d_video->pack_no*100.0/(float)mpctx->sh_video->video.dwLength;
    1.17 ++      }
    1.18 ++    else {
    1.19 ++      off_t len = ( mpctx->demuxer->movi_end - mpctx->demuxer->movi_start );
    1.20 ++      off_t pos = ( mpctx->demuxer->file_format == DEMUXER_TYPE_AUDIO?mpctx->stream->pos:mpctx->demuxer->filepos );
    1.21 ++      if(len>0) position=( pos - mpctx->demuxer->movi_start ) * 100.0 / len;
    1.22 ++      }
    1.23 ++    if(mpctx->sh_video) time=mpctx->d_video->pts;
    1.24 ++    else if(mpctx->sh_audio) time=mpctx->sh_audio->delay;
    1.25 ++    mp_msg(MSGT_OSD,MSGL_ERR,"SLAVE: time=%.2f position=%.2f\r",time,position);
    1.26 ++    }
    1.27 ++#endif
    1.28 ++
    1.29 + #ifdef HAVE_NEW_GUI
    1.30 +       if(use_gui){
    1.31 +         guiEventHandling();