summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-25 20:32:02 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-25 20:32:02 +0000
commit4b08102347cb4c0274b7aaf0106a8fd04d8b0a79 (patch)
tree36cab39cba1cb80470dc1921185a8ec944d11f05
parente2b276840aa2471dc2ea58dc342b1724b1292c23 (diff)
downloadmpv-4b08102347cb4c0274b7aaf0106a8fd04d8b0a79.tar.bz2
mpv-4b08102347cb4c0274b7aaf0106a8fd04d8b0a79.tar.xz
dvd seeking -> subtitle disappearing bugs fixed
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3745 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--mplayer.c4
-rw-r--r--spudec.c12
-rw-r--r--spudec.h1
3 files changed, 15 insertions, 2 deletions
diff --git a/mplayer.c b/mplayer.c
index 442dd3b8e6..3eaa7d6ab0 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -2115,6 +2115,10 @@ if(rel_seek_secs || abs_seek_pos){
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;
diff --git a/spudec.c b/spudec.c
index a128a6e40b..f7cf698c1b 100644
--- a/spudec.c
+++ b/spudec.c
@@ -284,9 +284,10 @@ void spudec_assemble(void *this, unsigned char *packet, int len, int pts100)
}
} 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_assemble(void *this, unsigned char *packet, int len, int pts100)
}
}
+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;
diff --git a/spudec.h b/spudec.h
index 397c883b87..701e62785a 100644
--- a/spudec.h
+++ b/spudec.h
@@ -9,6 +9,7 @@ void spudec_assemble(void *this, unsigned char *packet, int len, int pts100);
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