patches/mplayer-0.90rc1-slavemode.diff
author nathan
Sun, 06 Dec 2009 08:48:57 +0800
branchtrunk
changeset 34 afc13760179b
parent 0 474a1293c3c0
permissions -rw-r--r--
fixed gcc 4.4.1 const errors
     1 diff -ruN ./mplayer.c /usr/src/MPlayer-0.90rc1/mplayer.c
     2 --- ./mplayer.c	Thu Dec  5 01:18:56 2002
     3 +++ /usr/src/MPlayer-0.90rc1/mplayer.c	Wed Dec 11 15:49:50 2002
     4 @@ -2682,6 +2682,25 @@
     5    current_module=NULL;
     6  }
     7  
     8 +#if 1
     9 +  if(slave_mode){
    10 +    float position=0.0;
    11 +    float time=0.0;
    12 +    if(demuxer->file_format==DEMUXER_TYPE_AVI && sh_video->video.dwLength>2) {
    13 +      // get pos from frame number / total frames
    14 +      position=(float)d_video->pack_no*100.0/(float)sh_video->video.dwLength;
    15 +      }
    16 +    else {
    17 +      off_t len = ( demuxer->movi_end - demuxer->movi_start );
    18 +      off_t pos = ( demuxer->file_format == DEMUXER_TYPE_AUDIO?stream->pos:demuxer->filepos );
    19 +      if(len>0) position=( pos - demuxer->movi_start ) * 100.0 / len;
    20 +      }
    21 +    if(sh_video) time=d_video->pts;
    22 +    else if(sh_audio) time=sh_audio->delay;
    23 +    mp_msg(MSGT_OSD,MSGL_ERR,"SLAVE: time=%.2f position=%.2f\r",time,position);
    24 +    }
    25 +#endif
    26 +
    27  #ifdef HAVE_NEW_GUI
    28        if(use_gui){
    29          guiEventHandling();