summaryrefslogtreecommitdiff
path: root/libavformat/bink.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2010-02-24 11:43:33 +0000
committerPeter Ross <pross@xvid.org>2010-02-24 11:43:33 +0000
commitdd80be5bfcc4135906cf9aff516c82c6efca18bd (patch)
tree980dbaec3f050d11be1a9df7847afc6c4c3d3799 /libavformat/bink.c
parent7e276c85b137ff369a671b3c9d5edd2165d415b0 (diff)
low-complexity Bink file seeking
Originally committed as revision 22022 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/bink.c')
-rw-r--r--libavformat/bink.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavformat/bink.c b/libavformat/bink.c
index 5f357a47de..10bbbccb29 100644
--- a/libavformat/bink.c
+++ b/libavformat/bink.c
@@ -241,6 +241,19 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
+static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
+{
+ BinkDemuxContext *bink = s->priv_data;
+ AVStream *vst = s->streams[0];
+
+ /* seek to the first frame */
+ url_fseek(s->pb, vst->index_entries[0].pos, SEEK_SET);
+ bink->video_pts = 0;
+ memset(bink->audio_pts, 0, sizeof(bink->audio_pts));
+ bink->current_track = -1;
+ return 0;
+}
+
AVInputFormat bink_demuxer = {
"bink",
NULL_IF_CONFIG_SMALL("Bink"),
@@ -248,4 +261,6 @@ AVInputFormat bink_demuxer = {
probe,
read_header,
read_packet,
+ NULL,
+ read_seek,
};