Mercurial > libavformat.hg
comparison ffm.c @ 558:89bd76208427 libavformat
100l (forgoten seeking functions)
author | michael |
---|---|
date | Mon, 11 Oct 2004 23:53:53 +0000 |
parents | 26a477a5ebda |
children | 095009fc2f35 |
comparison
equal
deleted
inserted
replaced
557:084de726b4d0 | 558:89bd76208427 |
---|---|
625 } | 625 } |
626 | 626 |
627 /* seek to a given time in the file. The file read pointer is | 627 /* seek to a given time in the file. The file read pointer is |
628 positionned at or before pts. XXX: the following code is quite | 628 positionned at or before pts. XXX: the following code is quite |
629 approximative */ | 629 approximative */ |
630 static int ffm_seek(AVFormatContext *s, int64_t wanted_pts) | 630 static int ffm_seek(AVFormatContext *s, int stream_index, int64_t wanted_pts, int flags) |
631 { | 631 { |
632 FFMContext *ffm = s->priv_data; | 632 FFMContext *ffm = s->priv_data; |
633 offset_t pos_min, pos_max, pos; | 633 offset_t pos_min, pos_max, pos; |
634 int64_t pts_min, pts_max, pts; | 634 int64_t pts_min, pts_max, pts; |
635 double pos1; | 635 double pos1; |
660 pos_max = pos - FFM_PACKET_SIZE; | 660 pos_max = pos - FFM_PACKET_SIZE; |
661 } else { | 661 } else { |
662 pos_min = pos + FFM_PACKET_SIZE; | 662 pos_min = pos + FFM_PACKET_SIZE; |
663 } | 663 } |
664 } | 664 } |
665 pos = pos_min; | 665 pos = (flags & AVSEEK_FLAG_BACKWARD) ? pos_min : pos_max; |
666 if (pos > 0) | 666 if (pos > 0) |
667 pos -= FFM_PACKET_SIZE; | 667 pos -= FFM_PACKET_SIZE; |
668 found: | 668 found: |
669 ffm_seek1(s, pos); | 669 ffm_seek1(s, pos); |
670 return 0; | 670 return 0; |