[Mplayer-cvslog] CVS: main mplayer.c,1.739,1.740 vobsub.c,1.34,1.35 vobsub.h,1.10,1.11

Alex Beregszaszi alex at mplayerhq.hu
Mon Dec 8 19:36:16 CET 2003


Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv7696

Modified Files:
	mplayer.c vobsub.c vobsub.h 
Log Message:
vobsub seeking support by Lu Ran

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.739
retrieving revision 1.740
diff -u -r1.739 -r1.740
--- mplayer.c	8 Dec 2003 13:30:29 -0000	1.739
+++ mplayer.c	8 Dec 2003 18:35:39 -0000	1.740
@@ -3398,7 +3398,8 @@
       /* FIXME there should be real seeking for vobsub */
       if(sh_video) sh_video->pts=d_video->pts;
       if (vo_vobsub)
-	vobsub_reset(vo_vobsub);
+	//vobsub_reset(vo_vobsub);
+	vobsub_seek(vo_vobsub,sh_video->pts);
 #if 0
       if(sh_video && d_video->packs == 0)
 	ds_fill_buffer(d_video);

Index: vobsub.c
===================================================================
RCS file: /cvsroot/mplayer/main/vobsub.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- vobsub.c	28 Oct 2003 22:36:56 -0000	1.34
+++ vobsub.c	8 Dec 2003 18:35:39 -0000	1.35
@@ -1267,6 +1267,22 @@
   return -1;
 }
 
+void vobsub_seek(void * vobhandle, float pts)
+{
+  vobsub_t * vob = (vobsub_t *)vobhandle;
+  packet_queue_t * queue;
+  int seek_pts100 = (int)pts * 90000;
+
+  if (vob->spu_streams && 0 <= vobsub_id && (unsigned) vobsub_id < vob->spu_streams_size) {
+    queue = vob->spu_streams + vobsub_id;
+    queue->current_index = 0;
+    while ((queue->packets + queue->current_index)->pts100 < seek_pts100)
+      ++queue->current_index;
+    if (queue->current_index > 0);
+      --queue->current_index;
+  }
+}
+
 void
 vobsub_reset(void *vobhandle)
 {

Index: vobsub.h
===================================================================
RCS file: /cvsroot/mplayer/main/vobsub.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- vobsub.h	21 Sep 2003 14:21:11 -0000	1.10
+++ vobsub.h	8 Dec 2003 18:35:39 -0000	1.11
@@ -15,6 +15,7 @@
 extern void vobsub_out_close(void *me);
 extern int vobsub_set_from_lang(void *vobhandle, unsigned char * lang);
 extern unsigned int vobsub_get_forced_subs_flag(void const * const vobhandle);
+extern void vobsub_seek(void * vobhandle, float pts);
 
 #endif /* MPLAYER_VOBSUB_H */
 



More information about the MPlayer-cvslog mailing list