changeset 3744:d358f4a74690

dvd seeking -> subtitle disappearing bugs fixed
author arpi
date Tue, 25 Dec 2001 20:32:02 +0000
parents 38ee592422aa
children db95315504fd
files mplayer.c spudec.c spudec.h
diffstat 3 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Tue Dec 25 19:25:27 2001 +0000
+++ b/mplayer.c	Tue Dec 25 20:32:02 2001 +0000
@@ -2115,6 +2115,10 @@
       drop_frame_cnt=0;
       too_slow_frame_cnt=0;
       too_fast_frame_cnt=0;
+
+#ifdef USE_DVDREAD
+      if(vo_spudec) spudec_reset(vo_spudec);
+#endif
   }
   rel_seek_secs=0;
   abs_seek_pos=0;
--- a/spudec.c	Tue Dec 25 19:25:27 2001 +0000
+++ b/spudec.c	Tue Dec 25 20:32:02 2001 +0000
@@ -284,9 +284,10 @@
     }
   } else {
     // Continue current fragment
-    if (spu->packet_size < spu->packet_offset + len)
+    if (spu->packet_size < spu->packet_offset + len){
       fprintf(stderr,"invalid fragment\n");
-    else {
+      spu->packet_size = spu->packet_offset = 0;
+    } else {
       memcpy(spu->packet + spu->packet_offset, packet, len);
       spu->packet_offset += len;
     }
@@ -297,6 +298,13 @@
   }
 }
 
+void spudec_reset(void *this)	// called after seek
+{
+  spudec_handle_t *spu = (spudec_handle_t*)this;
+  spu->now_pts = -1;
+  spu->packet_size = spu->packet_offset = 0;
+}
+
 void spudec_heartbeat(void *this, int pts100)
 {
   ((spudec_handle_t *)this)->now_pts = pts100;
--- a/spudec.h	Tue Dec 25 19:25:27 2001 +0000
+++ b/spudec.h	Tue Dec 25 20:32:02 2001 +0000
@@ -9,6 +9,7 @@
 void spudec_draw(void *this, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
 void *spudec_new(dvd_priv_t *dvd_info);
 void spudec_free(void *this);
+void spudec_reset(void *this);	// called after seek
 
 #endif
 #endif