patches/mplayer-0.90rc5-slavemode.diff
branchtrunk
changeset 0 474a1293c3c0
equal deleted inserted replaced
-1:000000000000 0:474a1293c3c0
       
     1 --- mplayer.c.orig	2003-03-10 15:02:18.000000000 +0100
       
     2 +++ mplayer.c	2003-03-29 14:58:17.000000000 +0100
       
     3 @@ -3114,6 +3114,25 @@
       
     4    loop_seek=0;
       
     5  }
       
     6  
       
     7 +#if 1
       
     8 +  if(slave_mode){
       
     9 +    float position=0.0;
       
    10 +    float time=0.0;
       
    11 +    if(demuxer->file_format==DEMUXER_TYPE_AVI && sh_video->video.dwLength>2) {
       
    12 +      // get pos from frame number / total frames
       
    13 +      position=(float)d_video->pack_no*100.0/(float)sh_video->video.dwLength;
       
    14 +      }
       
    15 +    else {
       
    16 +      off_t len = ( demuxer->movi_end - demuxer->movi_start );
       
    17 +      off_t pos = ( demuxer->file_format == DEMUXER_TYPE_AUDIO?stream->pos:demuxer->filepos );
       
    18 +      if(len>0) position=( pos - demuxer->movi_start ) * 100.0 / len;
       
    19 +      }
       
    20 +    if(sh_video) time=d_video->pts;
       
    21 +    else if(sh_audio) time=sh_audio->delay;
       
    22 +    mp_msg(MSGT_OSD,MSGL_ERR,"SLAVE: time=%.2f position=%.2f\r",time,position);
       
    23 +    }
       
    24 +#endif
       
    25 +
       
    26  #ifdef HAVE_NEW_GUI
       
    27        if(use_gui){
       
    28          guiEventHandling();