Mercurial > mplayer.hg
diff vobsub.c @ 6829:d7db9f1b1d36
New function vobsub_get_next_packet for subrip.
author | kmkaplan |
---|---|
date | Sun, 28 Jul 2002 16:28:30 +0000 |
parents | b1f788bca721 |
children | f628e5dca5b9 |
line wrap: on
line diff
--- a/vobsub.c Sun Jul 28 15:54:26 2002 +0000 +++ b/vobsub.c Sun Jul 28 16:28:30 2002 +0000 @@ -978,6 +978,23 @@ 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) {