summaryrefslogtreecommitdiffstats
path: root/spudec.c
diff options
context:
space:
mode:
Diffstat (limited to 'spudec.c')
-rw-r--r--spudec.c12
1 files changed, 10 insertions, 2 deletions
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;