low-complexity Bink file seeking
Originally committed as revision 22022 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
7e276c85b1
commit
dd80be5bfc
@ -241,6 +241,19 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
return 0;
|
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 = {
|
AVInputFormat bink_demuxer = {
|
||||||
"bink",
|
"bink",
|
||||||
NULL_IF_CONFIG_SMALL("Bink"),
|
NULL_IF_CONFIG_SMALL("Bink"),
|
||||||
@ -248,4 +261,6 @@ AVInputFormat bink_demuxer = {
|
|||||||
probe,
|
probe,
|
||||||
read_header,
|
read_header,
|
||||||
read_packet,
|
read_packet,
|
||||||
|
NULL,
|
||||||
|
read_seek,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user