diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-12-08 18:35:39 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-12-08 18:35:39 +0000 |
commit | 0955d2393468b2a92ef3e1a79f512a19613e3375 (patch) | |
tree | c46fcc1d018f4d881ae7f760e35153516918323a /vobsub.c | |
parent | d5066b11efa2ea244f0efbc0bc07604af5294b75 (diff) | |
download | mpv-0955d2393468b2a92ef3e1a79f512a19613e3375.tar.bz2 mpv-0955d2393468b2a92ef3e1a79f512a19613e3375.tar.xz |
vobsub seeking support by Lu Ran
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11590 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'vobsub.c')
-rw-r--r-- | vobsub.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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) { |