comparison bink.c @ 5711:1481fbffd30b libavformat

low-complexity Bink file seeking
author pross
date Wed, 24 Feb 2010 11:43:33 +0000
parents 85ecf46ae931
children 9a98bc214731
comparison
equal deleted inserted replaced
5710:85ecf46ae931 5711:1481fbffd30b
239 bink->current_track = -1; 239 bink->current_track = -1;
240 240
241 return 0; 241 return 0;
242 } 242 }
243 243
244 static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
245 {
246 BinkDemuxContext *bink = s->priv_data;
247 AVStream *vst = s->streams[0];
248
249 /* seek to the first frame */
250 url_fseek(s->pb, vst->index_entries[0].pos, SEEK_SET);
251 bink->video_pts = 0;
252 memset(bink->audio_pts, 0, sizeof(bink->audio_pts));
253 bink->current_track = -1;
254 return 0;
255 }
256
244 AVInputFormat bink_demuxer = { 257 AVInputFormat bink_demuxer = {
245 "bink", 258 "bink",
246 NULL_IF_CONFIG_SMALL("Bink"), 259 NULL_IF_CONFIG_SMALL("Bink"),
247 sizeof(BinkDemuxContext), 260 sizeof(BinkDemuxContext),
248 probe, 261 probe,
249 read_header, 262 read_header,
250 read_packet, 263 read_packet,
264 NULL,
265 read_seek,
251 }; 266 };