summaryrefslogtreecommitdiffstats
path: root/vobsub.c
diff options
context:
space:
mode:
Diffstat (limited to 'vobsub.c')
-rw-r--r--vobsub.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/vobsub.c b/vobsub.c
index c2b313ca0b..2e2874242b 100644
--- a/vobsub.c
+++ b/vobsub.c
@@ -1267,6 +1267,22 @@ vobsub_get_next_packet(void *vobhandle, void** data, int* timestamp)
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)
{