[MPlayer-dev-eng] Patch for Mplayer to support VDR/DVB

C.Y.M cym at syphir.sytes.net
Fri Nov 5 07:36:17 CET 2004


Is this patch an acceptable addition to mplayer?  It is used by VDR/DVB 
to support playback through the DVB card.


--- main/mplayer.c.orig 2004-11-04 20:32:05.000000000 -0800
+++ main/mplayer.c      2004-11-04 20:32:35.000000000 -0800
@@ -3781,6 +3781,25 @@
    loop_seek=0;
  }

+#if 1
+  if(slave_mode){
+    float position=0.0;
+    float time=0.0;
+    if(demuxer->file_format==DEMUXER_TYPE_AVI && 
sh_video->video.dwLength>2) {
+      // get pos from frame number / total frames
+ 
position=(float)d_video->pack_no*100.0/(float)sh_video->video.dwLength;
+      }
+    else {
+      off_t len = ( demuxer->movi_end - demuxer->movi_start );
+      off_t pos = ( demuxer->file_format == 
DEMUXER_TYPE_AUDIO?stream->pos:demuxer->filepos );
+      if(len>0) position=( pos - demuxer->movi_start ) * 100.0 / len;
+      }
+    if(sh_video) time=d_video->pts;
+    else if(sh_audio) time=sh_audio->delay;
+    mp_msg(MSGT_OSD,MSGL_ERR,"SLAVE: time=%.2f 
position=%.2f\r",time,position);
+    }
+#endif
+
  #ifdef HAVE_NEW_GUI
        if(use_gui){
          guiEventHandling();




More information about the MPlayer-dev-eng mailing list