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