-void
-FFmpegDecoder::seek (ContentTime time, bool accurate)
-{
- VideoDecoder::seek (time, accurate);
- AudioDecoder::seek (time, accurate);
-
- /* If we are doing an accurate seek, our initial shot will be 2s (2 being
- a number plucked from the air) earlier than we want to end up. The loop below
- will hopefully then step through to where we want to be.
- */
-
- ContentTime pre_roll = accurate ? ContentTime::from_seconds (2) : ContentTime (0);
- ContentTime initial_seek = time - pre_roll;
- if (initial_seek < ContentTime (0)) {
- initial_seek = ContentTime (0);
- }
-
- seek_and_flush (initial_seek);
-}
-