Mercurial > libavformat.hg
changeset 5711:1481fbffd30b libavformat
low-complexity Bink file seeking
author | pross |
---|---|
date | Wed, 24 Feb 2010 11:43:33 +0000 |
parents | 85ecf46ae931 |
children | 20877abd6b08 |
files | bink.c |
diffstat | 1 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/bink.c Wed Feb 24 11:30:38 2010 +0000 +++ b/bink.c Wed Feb 24 11:43:33 2010 +0000 @@ -241,6 +241,19 @@ 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 @@ probe, read_header, read_packet, + NULL, + read_seek, };