From 0b97307b78b1d5e017e97ff90d5d05102cb70c1c Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 7 Jun 2013 17:07:02 +0100 Subject: Fix seeks past the end of video files. --- src/lib/video_decoder.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/lib/video_decoder.cc') diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index a5147f42e..c5e1850c0 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -121,3 +121,27 @@ VideoDecoder::video_done () const return (_video_content->length() - _next_video) < film->video_frames_to_time (1); } + +void +VideoDecoder::seek (Time t) +{ + _next_video = t; +} + +void +VideoDecoder::seek_back () +{ + shared_ptr film = _film.lock (); + assert (film); + _next_video -= film->video_frames_to_time (1); +} + +void +VideoDecoder::seek_forward () +{ + shared_ptr film = _film.lock (); + assert (film); + _next_video += film->video_frames_to_time (1); +} + + -- cgit v1.2.3