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