diff options
author | kmkaplan <kmkaplan@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-07-28 16:28:30 +0000 |
---|---|---|
committer | kmkaplan <kmkaplan@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-07-28 16:28:30 +0000 |
commit | 599cf07dc3b56385b727c03d537bba0bcc061869 (patch) | |
tree | c7316dcdaca5b6d0945b762f1a6cc9e5ead6c1cd | |
parent | 1d3c0d399932d268ee8139d3e18238b96c0c8364 (diff) | |
download | mpv-599cf07dc3b56385b727c03d537bba0bcc061869.tar.bz2 mpv-599cf07dc3b56385b727c03d537bba0bcc061869.tar.xz |
New function vobsub_get_next_packet for subrip.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6830 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | vobsub.c | 17 | ||||
-rw-r--r-- | vobsub.h | 1 |
2 files changed, 18 insertions, 0 deletions
@@ -978,6 +978,23 @@ vobsub_get_packet(void *vobhandle, float pts,void** data, int* timestamp) { return -1; } +int +vobsub_get_next_packet(void *vobhandle, void** data, int* timestamp) +{ + vobsub_t *vob = (vobsub_t *)vobhandle; + if (vob->spu_streams && 0 <= vobsub_id && (unsigned) vobsub_id < vob->spu_streams_size) { + packet_queue_t *queue = vob->spu_streams + vobsub_id; + if (queue->current_index < queue->packets_size) { + packet_t *pkt = queue->packets + queue->current_index; + ++queue->current_index; + *data = pkt->data; + *timestamp = pkt->pts100; + return pkt->size; + } + } + return -1; +} + void vobsub_reset(void *vobhandle) { @@ -5,6 +5,7 @@ extern void *vobsub_open(const char *subname, const char *const ifo, const int f extern void vobsub_reset(void *vob); extern int vobsub_parse_ifo(void* this, const char *const name, unsigned int *palette, unsigned int *width, unsigned int *height, int force, int sid, char *langid); extern int vobsub_get_packet(void *vobhandle, float pts,void** data, int* timestamp); +extern int vobsub_get_next_packet(void *vobhandle, void** data, int* timestamp); extern void vobsub_close(void *this); extern void *vobsub_out_open(const char *basename, const unsigned int *palette, unsigned int orig_width, unsigned int orig_height, const char *id, unsigned int index); |